:root {
    --bg: #0b0f17;
    --bg-2: #111725;
    --panel: #151c2c;
    --panel-2: #1b2436;
    --border: #24304a;
    --text: #e6ebf5;
    --muted: #8b97ad;
    --primary: #4f7cff;
    --primary-2: #3a68f0;
    --accent: #34d399;
    --warning: #f4b740;
    --danger: #f4606c;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Thanh cuộn — đồng màu primary */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-2);
}
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: var(--bg-2);
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    border-radius: 999px;
    border: 2px solid var(--bg-2);
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
*::-webkit-scrollbar-corner {
    background: var(--bg-2);
}

html { min-height: 100%; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: radial-gradient(1200px 600px at 70% -10%, #16203a, transparent), var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.page { flex: 1 0 auto; padding-bottom: 28px; }
.page:has(.bd-home) {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    background:
        radial-gradient(circle at 78% 23%, rgba(37, 99, 235, .18), transparent 28%),
        linear-gradient(122deg, #f8fbff 0%, #f0f6ff 46%, #e8f0ff 100%);
}

/* Navbar */
.navbar { border-bottom: 1px solid var(--border); background: rgba(11,15,23,.92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40; }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-dot, .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 0 14px var(--primary); }
.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}
.nav-links a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    color: #9aa8bf;
    font-size: .88rem;
    font-weight: 650;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-links a:hover {
    color: #eef3fb;
    background: rgba(255, 255, 255, .06);
}
.nav-links a.is-active {
    color: #fff;
    background: rgba(79, 124, 255, .18);
    border-color: rgba(79, 124, 255, .28);
}
.nav-sep {
    width: 1px;
    height: 18px;
    margin: 0 6px;
    background: rgba(148, 163, 184, .28);
    flex-shrink: 0;
}
.nav-auth {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 140px;
    padding: 0 8px;
    color: #9aa8bf;
    font-size: .84rem;
    font-weight: 650;
}
.nav-auth-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, .55);
    flex-shrink: 0;
}
.nav-auth-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hero */
.hero { padding: 80px 0 40px; text-align: center; }
.hero-badge { display: inline-block; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.hero h1 { font-size: 2.9rem; line-height: 1.15; margin: 0 0 18px; letter-spacing: -.02em; }
.hero-sub { max-width: 640px; margin: 0 auto 30px; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 700; cursor: pointer; border: 1px solid transparent; font-size: .95rem; transition: .15s; background: var(--panel); color: var(--text); }
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 8px 24px rgba(79,124,255,.35); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--panel); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 30px auto; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px auto 60px; }
.feature { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature h3 { margin: 0 0 10px; font-size: 1.15rem; }
.feature p { color: var(--muted); margin: 0; }

/* Cards / panels */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

/* Alerts */
.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin: 16px 0; border: 1px solid var(--border); background: var(--panel); }
.alert-info { border-color: #2b3d63; background: #16223a; }
.alert-warning { border-color: #5a4818; background: #2a2410; color: #f4d58a; }
.alert-danger { border-color: #5a2431; background: #2a1418; color: #f6a7b0; }
.alert-success { border-color: #1f5140; background: #10241d; color: #9be7c8; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; z-index: 1; }
table.data tr:hover td { background: var(--panel-2); }

/* Warehouse list — sticky toolbar + scroll panel */
.wh-hwid { padding-top: 12px; padding-bottom: 12px; }
.wh-hwid > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wh-hwid > summary::-webkit-details-marker { display: none; }
.wh-hwid-title { font-weight: 700; font-size: .95rem; }
.wh-hwid-title::before { content: '▸ '; color: var(--muted); }
.wh-hwid[open] .wh-hwid-title::before { content: '▾ '; }
.wh-hwid-result { max-height: 220px; overflow: auto; }
.wh-workspace { display: flex; flex-direction: column; gap: 0; padding-top: 14px; padding-bottom: 14px; }
.wh-toolbar {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 64px;
    z-index: 15;
    background: var(--panel);
    padding: 0 0 10px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}
.wh-toolbar .wh-q,
.wh-toolbar .wh-sel {
    width: auto;
    margin: 0;
    padding: 8px 10px;
    min-width: 0;
}
.wh-toolbar .wh-q {
    flex: 1 1 auto;
    min-width: 140px;
}
.wh-toolbar .wh-sel {
    flex: 0 0 auto;
    width: 150px;
}
.wh-toolbar .wh-sel-ring { width: 130px; }
.wh-toolbar .wh-sel-page { width: 110px; }
.wh-toolbar .wh-btn-filter {
    flex: 0 0 auto;
    padding: 8px 14px;
    white-space: nowrap;
}
.wh-meta {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; flex-wrap: wrap; padding: 8px 0;
}
.wh-meta-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; }
.wh-pager { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.wh-pager .is-disabled { opacity: .4; pointer-events: none; }
.wh-table-scroll {
    max-height: calc(100vh - 220px);
    min-height: 320px;
    overflow: auto;
}
@media (max-width: 900px) {
    .wh-toolbar {
        position: static;
        flex-wrap: wrap;
    }
    .wh-toolbar .wh-q { flex: 1 1 100%; width: 100%; }
    .wh-toolbar .wh-sel { flex: 1 1 calc(50% - 8px); width: auto; min-width: 120px; }
    .wh-table-scroll { max-height: 55vh; }
}

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--border); }
.badge-green { background: #10241d; color: var(--accent); border-color: #1f5140; }
.badge-blue { background: #14223f; color: #8fb0ff; border-color: #2b3d63; }
.badge-amber { background: #2a2410; color: var(--warning); border-color: #5a4818; }
.badge-gray { background: var(--panel-2); color: var(--muted); }

/* Forms */
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
    width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 9px; color: var(--text); font: inherit;
}
input[type=file] {
    width: 100%; margin-top: 6px; padding: 8px 10px; background: var(--bg-2); border: 1px dashed var(--border);
    border-radius: 9px; color: var(--muted); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label { margin: 0; }
.filters .grow { flex: 1; min-width: 180px; }

/* OEM admin forms */
.oem-form { display: flex; flex-direction: column; gap: 0; }
.oem-section { padding: 16px 0; border-top: 1px solid var(--border); }
.oem-section:first-of-type { border-top: 0; padding-top: 0; }
.oem-section-title { margin: 0 0 12px; font-size: .95rem; font-weight: 700; color: var(--text); }
.oem-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}
.oem-grid label { margin: 0; }
.oem-span-2 { grid-column: 1 / -1; }
.oem-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    margin-top: 28px !important;
}
.oem-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.oem-model-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding: 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 9px;
}
.oem-model-item {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    margin: 0 !important;
    font-weight: 500;
    font-size: .88rem;
    padding: 6px 8px;
    border-radius: 8px;
}
.oem-model-item:hover { background: var(--panel); }
.oem-model-item input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.oem-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.oem-filters { margin-bottom: 14px; }
.oem-detail-head { align-items: flex-start; }
.oem-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.oem-detail-actions form { margin: 0; }
.oem-meta-line { margin-top: 12px; word-break: break-all; }
.req { color: #f87171; }

@media (max-width: 720px) {
    .oem-grid { grid-template-columns: 1fr; }
    .oem-span-2 { grid-column: auto; }
    .oem-check { margin-top: 8px !important; }
}

/* Auth */
.auth-page { display: flex; justify-content: center; padding: 70px 20px; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.4rem; margin: 0 0 20px; }

/* Login — chuyên nghiệp */
.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    min-height: calc(100vh - 68px - 70px);
    background:
        radial-gradient(circle at 18% 20%, rgba(79, 124, 255, .18), transparent 34%),
        radial-gradient(circle at 82% 78%, rgba(56, 189, 248, .08), transparent 30%),
        linear-gradient(180deg, #0a1220 0%, #0b0f17 100%);
}
.auth-panel {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    width: min(920px, 100%);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: rgba(17, 24, 39, .72);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.auth-side {
    padding: 42px 40px;
    background:
        linear-gradient(160deg, rgba(37, 99, 235, .28), transparent 55%),
        linear-gradient(180deg, #111b2f, #0d1524);
    border-right: 1px solid rgba(148, 163, 184, .12);
}
.auth-side-kicker {
    display: inline-block;
    margin-bottom: 18px;
    color: #93c5fd;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.auth-side h2 {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(1.7rem, 2.4vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -.03em;
}
.auth-side > p {
    margin: 14px 0 0;
    color: #9aa8bf;
    line-height: 1.7;
}
.auth-points {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.auth-points li {
    position: relative;
    padding: 10px 12px 10px 34px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: #c7d4ea;
    font-size: .9rem;
}
.auth-points li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #34d399;
    font-weight: 800;
}
.auth-shell .auth-card {
    max-width: none;
    margin: 0;
    padding: 42px 40px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.auth-card-head { margin-bottom: 22px; }
.auth-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(79, 124, 255, .35);
    background: rgba(79, 124, 255, .12);
    color: #bfdbfe;
    font-size: .72rem;
    font-weight: 750;
}
.auth-card-head h1 {
    margin: 0;
    font-size: 1.75rem;
    letter-spacing: -.03em;
}
.auth-card-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .92rem;
}
.auth-field { margin-bottom: 14px; }
.auth-field input {
    margin-top: 7px;
    padding: 12px 14px;
    background: rgba(8, 15, 29, .85);
}
.auth-submit {
    margin-top: 8px;
    min-height: 46px;
    justify-content: center;
}
.auth-back {
    display: inline-flex;
    margin-top: 16px;
    color: #9aa8bf;
    font-size: .88rem;
    font-weight: 650;
}
.auth-back:hover { color: #e8eef8; }
.page:has(.auth-shell) { padding-bottom: 0; }
body:has(.auth-shell) .site-footer {
    border-top-color: rgba(148, 163, 184, .14);
    background: transparent;
    color: #7b889e;
}
@media (max-width: 820px) {
    .auth-panel { grid-template-columns: 1fr; }
    .auth-side { border-right: 0; border-bottom: 1px solid rgba(148, 163, 184, .12); padding: 28px 24px; }
    .auth-shell .auth-card { padding: 28px 24px 32px; }
    .auth-points { display: none; }
}

/* Footer */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: auto;
    color: var(--muted);
    font-size: .9rem;
}
.site-footer .container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    text-align: center;
}
body:has(.bd-home) .site-footer {
    border-top-color: #d5e0ef;
    background: #eef4fc;
    color: #5b6b82;
}

/* Error */
.error-page { text-align: center; padding: 90px 20px; }
.error-page h1 { font-size: 4rem; margin: 0; }

/* Admin shell */
.admin-shell { display: flex; flex: 1 0 auto; width: 100%; min-height: 100vh; }
.admin-side { width: 240px; background: var(--bg-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.admin-brand { font-weight: 800; display: flex; align-items: center; gap: 10px; padding: 8px 10px 20px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { padding: 10px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.admin-nav a:hover { background: var(--panel); color: var(--text); }
.admin-nav a.is-active { background: var(--primary); color: #fff; }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px; border-top: 1px solid var(--border); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.admin-top { display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(11,15,23,.85); backdrop-filter: blur(8px); z-index: 20; }
.admin-top h1 { font-size: 1.25rem; margin: 0; flex: 1; }
.admin-content { flex: 1 0 auto; padding: 26px; }
.side-toggle { display: none; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; }

/* Wizard / steps */
.steps { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.step { flex: 1; min-width: 160px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: relative; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 8px; }
.step.active { border-color: var(--primary); }
.step.active .num { background: var(--primary); color: #fff; }
.step.done .num { background: var(--accent); color: #04150f; }

.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-check li.is-dup { opacity: .48; }
.list-check li.is-dup .driver-row-title { font-weight: 500; }
.list-check input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; }
.list-check input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
.driver-row-title { font-weight: 600; line-height: 1.35; margin-bottom: 2px; }
.scan-bulk {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 10px 12px; margin: 8px 0 4px; border-radius: 9px;
    background: var(--panel-2); border: 1px solid var(--border);
}
.scan-bulk-master {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; cursor: pointer; user-select: none;
    line-height: 1.2; margin: 0;
}
.scan-bulk-master input[type=checkbox] {
    width: 18px; height: 18px; margin: 0; padding: 0;
    flex-shrink: 0; align-self: center;
    position: relative; top: 0;
    accent-color: var(--primary);
}
.scan-bulk-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scan-bulk-actions .btn { padding: 6px 10px; font-size: .85rem; }
.scan-bulk-stat { margin-left: auto; color: var(--muted); font-size: .85rem; line-height: 1.2; }
.grow { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; opacity: .8; }

.status-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; background: var(--panel-2); margin: 10px 0; }
.upload-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 9px; background: var(--panel-2); margin: 10px 0; }
.upload-progress-phase { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-progress-phase strong { font-weight: 600; }
.progress-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; position: relative; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .35s ease; }
.progress-track--pulse::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: translateX(-100%);
  animation: dw-progress-shimmer 1.6s ease-in-out infinite;
}
@keyframes dw-progress-shimmer {
  100% { transform: translateX(100%); }
}
.upload-progress.is-alive { box-shadow: inset 0 0 0 1px rgba(46, 160, 90, 0.25); }
.upload-progress.is-stale { box-shadow: inset 0 0 0 1px rgba(210, 153, 34, 0.4); }
.pulse-dot { animation: dw-pulse-dot 1.2s ease-in-out infinite; }
@keyframes dw-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.upload-live-hint { opacity: 0.75; font-size: 0.92em; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .feature-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.1rem; }
    .admin-side { position: fixed; left: -260px; z-index: 60; transition: left .2s; }
    body.side-open .admin-side { left: 0; }
    .side-toggle { display: inline-block; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-links a { padding: 8px 10px; }
}

/* Kho driver — toolbar 1 hàng (phải đứng SAU rule input/select width:100%) */
.admin .wh-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.admin .wh-toolbar > input[type=search].wh-q,
.admin .wh-toolbar > select.wh-sel,
.admin .wh-toolbar > button.wh-btn-filter {
    display: inline-block;
    float: none;
    margin: 0 !important;
    vertical-align: middle;
    box-sizing: border-box;
}
.admin .wh-toolbar > input[type=search].wh-q {
    flex: 1 1 0 !important;
    width: 0 !important;          /* flex grow — không full hàng */
    min-width: 160px;
    max-width: none;
    padding: 8px 10px !important;
}
.admin .wh-toolbar > select.wh-sel {
    flex: 0 0 auto !important;
    width: 200px !important;
    min-width: 0 !important;
    max-width: 200px !important;
    padding: 8px 10px !important;
}
.admin .wh-toolbar > select.wh-sel-ring {
    width: 150px !important;
    max-width: 150px !important;
}
.admin .wh-toolbar > select.wh-sel-page {
    width: 120px !important;
    max-width: 120px !important;
}
.admin .wh-toolbar > button.wh-btn-filter {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 8px 14px !important;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .admin .wh-toolbar {
        flex-wrap: wrap !important;
    }
    .admin .wh-toolbar > input[type=search].wh-q {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: none !important;
    }
    .admin .wh-toolbar > select.wh-sel,
    .admin .wh-toolbar > select.wh-sel-ring,
    .admin .wh-toolbar > select.wh-sel-page {
        flex: 1 1 calc(33.33% - 8px) !important;
        width: auto !important;
        max-width: none !important;
        min-width: 100px !important;
    }
}

/* =====================================================================
   Buffalo Driver — homepage 2026
   Trang chủ dùng hệ thiết kế riêng, không kế thừa hero/card-grid cũ.
   ===================================================================== */
.bd-home {
    --bd-ink: #0b1220;
    --bd-ink-soft: #334155;
    --bd-blue: #2563eb;
    --bd-blue-dark: #1749b4;
    --bd-cyan: #38bdf8;
    --bd-line: #dce5f2;
    --bd-paper: #f7f9fc;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-height: 0;
    background: transparent;
    color: var(--bd-ink);
    overflow: hidden;
}

.bd-hero {
    position: relative;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    padding: 72px 0;
    background: transparent;
    border-bottom: none;
}
.bd-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .38;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(59, 130, 246, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, .08) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to right, #000, transparent 58%);
}
.bd-hero-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr);
    align-items: center;
    gap: 76px;
}
.bd-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--bd-blue-dark);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.bd-eyebrow-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bd-blue);
    box-shadow: 0 0 0 5px rgba(37, 99, 235, .12);
}
.bd-hero-copy h1 {
    max-width: 680px;
    margin: 0;
    color: #101827;
    font-size: clamp(3.2rem, 5.2vw, 5.4rem);
    line-height: .98;
    letter-spacing: -.065em;
    font-weight: 800;
}
.bd-hero-copy h1 span {
    color: var(--bd-blue);
}
.bd-hero-copy > p {
    max-width: 610px;
    margin: 28px 0 0;
    color: #536174;
    font-size: 1.08rem;
    line-height: 1.8;
}
.bd-contrib {
    max-width: 610px;
    margin: 22px 0 0;
}
.bd-contrib-lead {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 750;
}
.bd-contrib-block {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #d7e3f4;
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
}
.bd-contrib-block strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3a8a;
    font-size: .92rem;
}
.bd-contrib-block ul {
    margin: 0;
    padding: 0 0 0 1.1rem;
    color: #536174;
    line-height: 1.65;
}
.bd-contrib-block li { margin: 2px 0; }
.bd-contrib-contact {
    margin: 12px 0 0;
    color: #475569;
    font-size: .95rem;
}
.bd-contrib-contact a {
    color: var(--bd-blue);
    font-weight: 800;
    text-decoration: none;
}
.bd-contrib-contact a:hover { text-decoration: underline; }
.bd-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 34px;
    align-items: stretch;
}
.bd-button-stacked {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 148px;
    min-height: 56px;
    padding: 7px 18px 6px;
    line-height: 1.1;
}
.bd-button-main {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: .9rem;
}
.bd-button-sub {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, .76);
    font-size: .64rem;
    font-weight: 650;
    letter-spacing: .015em;
    line-height: 1;
}
.bd-button-sub > span {
    color: #86efac;
    font-size: .46rem;
}
.bd-button {
    display: inline-flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 750;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.bd-button:hover {
    transform: translateY(-2px);
}
.bd-button-primary {
    color: #fff;
    background: var(--bd-blue);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .24);
}
.bd-button-primary:hover { background: var(--bd-blue-dark); }
.bd-button-secondary {
    color: #1e293b;
    background: rgba(255, 255, 255, .75);
    border-color: #cbd8ea;
}
.bd-button-secondary:hover { background: #fff; }
.bd-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
    color: #64748b;
    font-size: .8rem;
    font-weight: 650;
}
.bd-trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.bd-trust-row i {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #047857;
    background: #d1fae5;
    font-style: normal;
    font-size: .7rem;
}

.bd-console {
    position: relative;
    color: #e7efff;
    background: linear-gradient(150deg, #0d1a32, #111c31 58%, #0a1427);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(15, 36, 75, .28);
    overflow: hidden;
}
.bd-console::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    top: -120px;
    right: -60px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .22);
    filter: blur(30px);
}
.bd-console-top,
.bd-console-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bd-console-top {
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.bd-console-top > div { display: flex; flex-direction: column; gap: 4px; }
.bd-console-kicker {
    color: #7193c7;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .16em;
}
.bd-console-top strong { font-size: .98rem; }
.bd-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid rgba(52, 211, 153, .28);
    border-radius: 999px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .08);
    font-size: .7rem;
    font-weight: 700;
}
.bd-live i,
.bd-console-foot i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
}
.bd-console-main { padding: 24px; }
.bd-health {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}
.bd-health-ring {
    display: flex;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    align-items: baseline;
    justify-content: center;
    padding-top: 25px;
    border: 7px solid rgba(37, 99, 235, .22);
    border-top-color: #4f8bff;
    border-right-color: #4f8bff;
    border-radius: 50%;
    transform: rotate(-20deg);
}
.bd-health-ring span,
.bd-health-ring small { transform: rotate(20deg); }
.bd-health-ring span { font-size: 1.25rem; font-weight: 800; }
.bd-health-ring small { margin-left: 1px; color: #8296b8; font-size: .65rem; }
.bd-health > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.bd-health > div:last-child span { color: #7f96b9; font-size: .72rem; }
.bd-health > div:last-child strong { color: #fff; font-size: 1rem; }
.bd-health > div:last-child small { color: #9badc8; }
.bd-console-list { margin-top: 10px; }
.bd-console-list > div {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.bd-console-list > div:last-child { border-bottom: 0; }
.bd-list-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 850;
}
.bd-list-icon-blue { color: #93c5fd; background: rgba(59, 130, 246, .16); }
.bd-list-icon-green { color: #6ee7b7; background: rgba(16, 185, 129, .14); }
.bd-list-icon-violet { color: #c4b5fd; background: rgba(139, 92, 246, .15); }
.bd-console-list span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.bd-console-list strong { color: #dce7f8; font-size: .8rem; }
.bd-console-list small { color: #7184a3; font-size: .67rem; }
.bd-console-list b { color: #fff; font-size: 1.05rem; }
.bd-console-foot {
    padding: 16px 24px;
    color: #7f93b2;
    background: rgba(3, 9, 20, .28);
    font-size: .7rem;
}
.bd-console-foot > span { display: flex; align-items: center; gap: 8px; }
.bd-console-foot a { color: #91b5ff; font-weight: 700; }
.bd-db-alert { position: relative; z-index: 2; margin-top: -30px; }

.bd-metrics {
    padding: 92px 0 96px;
    background: #fff;
}
.bd-section-intro { max-width: 720px; }
.bd-section-intro > span,
.bd-mini-label,
.bd-final-inner > div:first-child > span {
    color: var(--bd-blue);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .14em;
}
.bd-section-intro h2,
.bd-capabilities h2,
.bd-final h2 {
    margin: 12px 0 0;
    color: var(--bd-ink);
    font-size: clamp(2rem, 3.1vw, 3.1rem);
    line-height: 1.16;
    letter-spacing: -.045em;
}
.bd-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 42px;
    border-top: 1px solid var(--bd-line);
    border-left: 1px solid var(--bd-line);
}
.bd-metric-grid article {
    min-height: 166px;
    padding: 27px 28px;
    border-right: 1px solid var(--bd-line);
    border-bottom: 1px solid var(--bd-line);
    transition: background .2s ease;
}
.bd-metric-grid article:hover { background: #f8fbff; }
.bd-metric-grid strong {
    display: block;
    margin-bottom: 15px;
    color: var(--bd-blue);
    font-size: 2.5rem;
    line-height: 1;
    letter-spacing: -.05em;
}
.bd-metric-grid span { display: block; color: var(--bd-ink); font-weight: 750; }
.bd-metric-grid small { display: block; margin-top: 4px; color: #7a8799; }

.bd-workflow {
    padding: 94px 0 100px;
    color: #e8eef8;
    background:
        radial-gradient(circle at 75% 0%, rgba(37, 99, 235, .22), transparent 32%),
        #0b1426;
}
.bd-section-intro-light { max-width: 730px; }
.bd-section-intro-light > span { color: #67a0ff; }
.bd-section-intro-light h2 { color: #fff; }
.bd-section-intro-light p { margin: 18px 0 0; color: #91a0b9; line-height: 1.75; }
.bd-flow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 50px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .1);
}
.bd-flow-grid article {
    position: relative;
    min-height: 310px;
    padding: 32px;
    background: #0e192d;
}
.bd-step-num {
    position: absolute;
    top: 22px;
    right: 24px;
    color: #39506f;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
}
.bd-step-icon {
    display: flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    margin: 44px 0 34px;
    border: 1px solid rgba(96, 165, 250, .3);
    border-radius: 10px;
    color: #7db1ff;
    background: rgba(37, 99, 235, .1);
    font-size: 1.35rem;
}
.bd-flow-grid h3 { margin: 0 0 13px; color: #fff; font-size: 1.2rem; }
.bd-flow-grid p { margin: 0; color: #8e9db5; line-height: 1.75; }

.bd-capabilities { padding: 100px 0; background: var(--bd-paper); }
.bd-capabilities-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 100px;
    align-items: center;
}
.bd-capabilities p {
    margin: 22px 0 26px;
    color: #657287;
    line-height: 1.8;
}
.bd-capabilities-grid > div:first-child > a {
    color: var(--bd-blue);
    font-weight: 800;
}
.bd-capabilities-grid > div:first-child > a span { margin-left: 8px; }
.bd-capability-list {
    border-top: 1px solid #d6dfeb;
}
.bd-capability-list article {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 16px;
    padding: 25px 0;
    border-bottom: 1px solid #d6dfeb;
}
.bd-capability-list i {
    color: var(--bd-blue);
    font-style: normal;
    font-size: .72rem;
    font-weight: 850;
}
.bd-capability-list span { display: flex; flex-direction: column; gap: 5px; }
.bd-capability-list strong { color: var(--bd-ink); font-size: 1rem; }
.bd-capability-list small { color: #748196; line-height: 1.6; }

.bd-final {
    padding: 70px 0;
    color: #fff;
    background: var(--bd-blue);
}
.bd-final-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}
.bd-final-inner > div:first-child { max-width: 720px; }
.bd-final-inner > div:first-child > span { color: #bfdbfe; }
.bd-final h2 { max-width: 720px; color: #fff; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.bd-final-actions { display: flex; flex: 0 0 auto; gap: 10px; }
.bd-button-light { color: var(--bd-blue-dark); background: #fff; }
.bd-button-outline { color: #fff; border-color: rgba(255, 255, 255, .5); }
.bd-button-outline:hover { background: rgba(255, 255, 255, .1); }

/* Brand mark (áp dụng chung). */
.navbar {
    border-bottom-color: rgba(148, 163, 184, .17);
    background: rgba(8, 15, 29, .92);
}
.navbar-inner { height: 68px; }
.brand { letter-spacing: -.025em; }
.brand-dot {
    width: 22px;
    height: 22px;
    border-radius: 6px 2px 6px 2px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    transform: rotate(-8deg);
}

@media (max-width: 980px) {
    .bd-hero { padding: 72px 0; }
    .bd-hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .bd-hero-copy { max-width: 740px; }
    .bd-console { max-width: 650px; }
    .bd-capabilities-grid { grid-template-columns: 1fr; gap: 52px; }
    .bd-final-inner { align-items: flex-start; flex-direction: column; gap: 30px; }
}
@media (max-width: 720px) {
    .bd-hero { padding: 60px 0; }
    .bd-hero-grid { gap: 38px; }
    .bd-hero-copy h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
    .bd-hero-copy > p { font-size: .98rem; }
    .bd-trust-row { gap: 12px; }
    .bd-console-main { padding: 16px; }
    .bd-console-top, .bd-console-foot { padding: 16px; }
    .bd-metrics, .bd-workflow, .bd-capabilities { padding: 70px 0; }
    .bd-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .bd-flow-grid { grid-template-columns: 1fr; }
    .bd-flow-grid article { min-height: 260px; }
    .bd-final-actions { width: 100%; flex-wrap: wrap; }
    .nav-links a { padding: 7px 9px; font-size: .78rem; }
    .nav-auth-name { max-width: 72px; }
}
@media (max-width: 500px) {
    .bd-hero-actions, .bd-final-actions { flex-direction: column; }
    .bd-button { width: 100%; }
    .bd-health { align-items: flex-start; }
    .bd-health-ring { width: 68px; height: 68px; flex-basis: 68px; padding-top: 18px; }
    .bd-metric-grid { grid-template-columns: 1fr; }
    .bd-metric-grid article { min-height: 135px; }
    .bd-console-foot { align-items: flex-start; flex-direction: column; gap: 8px; }
    .brand { font-size: .92rem; }
    .nav-sep,
    .nav-auth { display: none; }
}

