/* =====================================================================
   THÃ€NH TÃN LOGISTICS â€” Design System
   ===================================================================== */
:root {
  --brand: #003470;
  --brand-2: #f17800;
  --brand-soft: #eef3f9;
  --ink: #101828;
  --ink-2: #344054;
  --ink-3: #667085;
  --ink-4: #98a2b3;
  --line: #e6e8ee;
  --line-2: #eef1f6;
  --bg: #f6f7fb;
  --card: #ffffff;
  --side: #0e1526;
  --side-2: #16203a;
  --ok: #039855;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --purple: #6941c6;
  --purple-soft: #f4f3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px -4px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }

/* ============================ LOGIN ============================ */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff;
}
.login-art {
  background: radial-gradient(120% 120% at 0% 0%, #1d5a9e 0%, #003470 45%, #001b3d 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-art::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 40L40 0' stroke='rgba(255,255,255,.07)' stroke-width='1'/%3E%3C/svg%3E");
}
.login-art > * { position: relative; z-index: 1; }
.login-logo {
  display: inline-flex; align-items: center; width: max-content; padding: 10px 16px;
  border-radius: 14px; background: #fff; box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .55);
}
.login-logo img { height: 54px; width: auto; }
.login-art h2 { font-size: 38px; line-height: 1.15; letter-spacing: -.8px; margin-bottom: 16px; }
.login-art p { color: rgba(255,255,255,.82); font-size: 15px; max-width: 440px; }
.login-feats { display: grid; gap: 12px; margin-top: 28px; }
.login-feats div { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.92); font-size: 14px; }
.login-feats i { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 12px; font-style: normal; }
.login-form-side { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 26px; letter-spacing: -.5px; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-3); margin-bottom: 24px; }
.portal-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--line-2); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.portal-switch button {
  border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 600;
  color: var(--ink-3); cursor: pointer; transition: .15s;
}
.portal-switch button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.login-hint { margin-top: 18px; padding: 12px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 12.5px; }

/* ============================ APP SHELL ============================ */
.app { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: #c7d0e0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-head {
  padding: 18px 18px 14px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: #fff; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 16px -8px rgba(0, 28, 61, .55), inset 0 0 0 1px rgba(0, 28, 61, .07);
}
.brand-mark img { width: 92%; height: 92%; object-fit: contain; }
.brand-text b { display: block; color: #fff; font-size: 15px; letter-spacing: .4px; }
.brand-text small { color: #7c8aa5; font-size: 11px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 24px; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #2a3550; border-radius: 4px; }
.nav-group { margin-top: 6px; }
.nav-group > .nav-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .9px;
  text-transform: uppercase; color: #6b7a97; cursor: pointer; user-select: none; border-radius: 8px;
}
.nav-group > .nav-title:hover { color: #a8b6cf; }
.nav-title .chev { transition: .2s; font-size: 9px; opacity: .7; }
.nav-group.collapsed .nav-items { display: none; }
.nav-group.collapsed .nav-title .chev { transform: rotate(-90deg); }
.nav-items { display: grid; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: #aab6cc; font-size: 13px; cursor: pointer; transition: .12s; position: relative;
}
.nav-link i { width: 17px; text-align: center; font-style: normal; opacity: .85; font-size: 13px; }
.nav-link:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(0, 52, 112,.22), rgba(0, 52, 112,.05)); color: #fff; font-weight: 600; }
.nav-link.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-link .pill {
  margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  background: rgba(255,255,255,.1); color: #dbe3f0;
}
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: #6b7a97; }

/* --------- Thanh tác vụ NGANG (Cấu hình chung → Bố cục thanh tác vụ) --------- */
.app.nav-top { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.app.nav-top .sidebar {
  position: relative; top: auto; height: auto; width: 100%;
  flex-direction: row; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
  z-index: 45;
}
.app.nav-top .sidebar-head {
  padding: 9px 14px; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); flex: 0 0 auto;
}
.app.nav-top .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.app.nav-top .brand-text small { display: none; }
.app.nav-top .sidebar-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px; flex: 1;
  padding: 8px 10px; overflow: visible;
}
.app.nav-top .nav-group { margin: 0; position: relative; }
.app.nav-top .nav-group > .nav-title {
  padding: 8px 11px; font-size: 10.5px; white-space: nowrap; border-radius: 8px;
  justify-content: flex-start; gap: 6px;
}
.app.nav-top .nav-group > .nav-title:hover,
.app.nav-top .nav-group.open > .nav-title { background: rgba(255,255,255,.09); color: #fff; }
.app.nav-top .nav-group.open > .nav-title .chev { transform: rotate(180deg); }
.app.nav-top .nav-items {
  position: absolute; top: 100%; left: 0; z-index: 80;
  display: none; min-width: 258px; padding: 10px 6px 6px; border-radius: 12px;
  background: var(--side-2); border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 48px -18px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.25);
  max-height: min(70vh, 520px); overflow-y: auto;
}
.app.nav-top .nav-group:hover .nav-items,
.app.nav-top .nav-group.open .nav-items { display: grid; }
.app.nav-top .nav-link.active { background: rgba(29,90,158,.45); }
.app.nav-top .nav-link.active::before { display: none; }
.app.nav-top .sidebar-foot { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar .crumb { font-size: 12px; color: var(--ink-4); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-2);
  transition: .15s;
}
.icon-btn:hover { background: var(--bg); border-color: #d5d9e2; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 30px; border: 1px solid var(--line); cursor: pointer; background: #fff; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-size: 12px; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); flex: 0 0 auto;
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.user-chip b { font-size: 12.5px; display: block; line-height: 1.2; }
.user-chip small { font-size: 10.5px; color: var(--ink-4); }
.content { padding: 22px; flex: 1; min-width: 0; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 60; display: none;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: 8px;
  font-size: 13px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink-2);
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); }
.dropdown .sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.rel { position: relative; }

/* ============================ CARD / LAYOUT ============================ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px;
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--ink-4); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0 } .mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px }
.mt20 { margin-top: 20px } .mb8 { margin-bottom: 8px } .mb12 { margin-bottom: 12px } .mb16 { margin-bottom: 16px }

/* ============================ STATS ============================ */
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  display: flex; flex-direction: column; gap: 4px; transition: .15s; cursor: pointer; position: relative; overflow: hidden;
}
.stat:hover { border-color: #cfd6e4; box-shadow: var(--shadow); transform: translateY(-1px); }
.stat .k { font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; gap: 6px; padding-right: 34px; }
.stat .v { font-size: 25px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 11.5px; color: var(--ink-4); }
.stat .ico {
  position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 14px;
}
.stat.a-deposit .ico { background: #fef3f2; color: #d92d20; }
.stat.a-received .ico { background: #fffaeb; color: #b54708; }
.stat.a-purchased .ico { background: #eff8ff; color: #175cd3; }
.stat.a-seller .ico { background: #f4f3ff; color: #6941c6; }
.stat.a-cn .ico { background: #ecfdf3; color: #039855; }
.stat.a-shipping .ico { background: #f0f9ff; color: #0b7ea8; }
.stat.a-vn .ico { background: #fdf2fa; color: #c11574; }
.stat.a-delivering .ico { background: #fff8f0; color: #dc6803; }
.stat.hero-card { background: linear-gradient(135deg, #fff 0%, #fff7f7 100%); border-color: #ffd9d9; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: .14s; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--bg); border-color: #d3d8e3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -6px rgba(0, 52, 112,.9); }
.btn-primary:hover { background: #00264f; border-color: #00264f; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #1b2436; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #027a48; }
.btn-danger { background: #fff; border-color: #fecdca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ============================ BADGES ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge.b-deposit, .badge.b-pending { background: #fffaeb; color: #b54708; }
.badge.b-received, .badge.b-created { background: #f2f4f7; color: #475467; }
.badge.b-paired, .badge.b-processing { background: #f4f3ff; color: #6941c6; }
.badge.b-purchased, .badge.b-cn_received, .badge.b-handled, .badge.b-approved { background: #eff8ff; color: #175cd3; }
.badge.b-seller_shipped, .badge.b-waiting_export, .badge.b-requested { background: #fff6ed; color: #c4320a; }
.badge.b-shipping, .badge.b-exported, .badge.b-delivering { background: #f0f9ff; color: #0b7ea8; }
.badge.b-vn_received, .badge.b-arrived, .badge.b-requested2 { background: #ecfdf3; color: #027a48; }
.badge.b-completed, .badge.b-delivered, .badge.b-success, .badge.b-refunded { background: #ecfdf3; color: #039855; }
.badge.b-canceled, .badge.b-rejected, .badge.b-failed, .badge.b-inactive { background: #fef3f2; color: #b42318; }
.badge.b-active { background: #ecfdf3; color: #039855; }
.badge.b-vip { background: linear-gradient(135deg, #fff4d6, #ffe0a3); color: #92600a; }
.badge.b-soft { background: var(--line-2); color: var(--ink-2); }

/* ============================ TABLE ============================ */
.table-wrap { width: 100%; overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tb th {
  background: #fafbfc; color: var(--ink-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .35px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tb th.sortable { cursor: pointer; user-select: none; }
table.tb th.sortable:hover { color: var(--ink); }
table.tb th .arr { opacity: .45; margin-left: 3px; font-size: 9px; }
table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr { transition: background .1s; }
table.tb tbody tr:hover { background: #fbfcfe; }
table.tb tbody tr.clickable { cursor: pointer; }
table.tb tbody tr.active { background: var(--brand-soft); }
table.tb tbody tr.active:hover { background: var(--brand-soft); }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb td.num, table.tb th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tb td.ctr, table.tb th.ctr { text-align: center; }
.tb .cell-main { font-weight: 600; color: var(--ink); }
.tb .cell-sub { font-size: 11.5px; color: var(--ink-4); }
.tb .thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.inspect-tb td { vertical-align: top; }
.inspect-tb .thumb { width: 54px; height: 54px; }
.inspect-tb tr.row-short td { background: #fffafa; }
.stock-tb td { vertical-align: middle; }
.stock-tb tr.stock-danger td { background: #fff6f5; }
.stock-tb tr.stock-warn td { background: #fffcf5; }
.stock-tb td .cell-sub { white-space: normal; }
table.tb tr.lot-group td { background: #f5f8fd; border-bottom: 1px solid var(--line); padding: 7px 12px; }
.tb .ops { display: flex; gap: 5px; justify-content: flex-end; }
.tb-empty { padding: 46px 20px; text-align: center; color: var(--ink-4); }
.tb-empty .big { font-size: 34px; opacity: .5; margin-bottom: 8px; }

/* ============================ FILTER BAR ============================ */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 13px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.toolbar .spacer { flex: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 13px 16px; background: #fcfcfd; border-bottom: 1px solid var(--line-2); align-items: flex-end; }
.field { display: grid; gap: 4px; }
.field > label { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 13px; transition: .15s; outline: none; min-height: 36px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 52, 112,.1); }
.input::placeholder { color: var(--ink-4); }
.textarea { min-height: 82px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.search-box { position: relative; }
.search-box .input { padding-left: 33px; min-width: 240px; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-style: normal; font-size: 13px; }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters .field[data-daterange] { flex: 0 0 100%; }
.filters .field[data-daterange] .row { flex-wrap: wrap; }

/* ============================ TABS ============================ */
.tabs { display: flex; gap: 4px; padding: 10px 16px 0; overflow-x: auto; border-bottom: 1px solid var(--line-2); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 13px; border-radius: 9px 9px 0 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px; transition: .13s;
}
.tab:hover { color: var(--ink); background: #fafbfc; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); background: var(--brand-soft); }
.tab .cnt { font-size: 10.5px; background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 20px; font-weight: 700; }
.tab.on .cnt { background: rgba(0, 52, 112,.14); color: var(--brand); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn { padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.pill-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ============================ CẢNH BÁO ĐƠN ĐANG MUA ============================ */
.buying-meta { display: flex; align-items: center; gap: 10px; padding: 11px 16px 0; }
.buying-meta .small { font-weight: 600; color: var(--ink-2); }
.alert-list { display: grid; gap: 8px; padding: 10px 16px 14px; background: #fcfcfd; border-bottom: 1px solid var(--line-2); }
.alert-group { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.alert-group.has-items { border-color: #fedf89; }
.alert-head {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
}
.alert-head:hover { background: #fafbfc; }
.alert-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #f2f4f7; color: var(--ink-3); flex: none; }
.alert-group.has-items .alert-dot { background: #fffaeb; color: #b54708; }
.alert-count { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 18px; }
.alert-group.has-items .alert-count { color: #b42318; }
.alert-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.alert-hint { font-size: 11px; color: var(--ink-4); }
.alert-chev { font-size: 13px; color: var(--ink-3); transition: transform .15s; margin-left: 4px; }
.alert-group.open .alert-chev { transform: rotate(180deg); }
.alert-body { border-top: 1px solid var(--line-2); background: #fff; }
.alert-body table.tb { font-size: 12px; }
.alert-body table.tb th { font-size: 10.5px; padding: 8px 10px; }
.alert-body table.tb td { padding: 7px 10px; }
.alert-foot { display: flex; justify-content: flex-end; padding: 8px 12px; border-top: 1px solid var(--line-2); background: #fcfcfd; }
.buying-meta [data-bucket-chip] { display: inline-flex; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 10px; padding: 0 2px; opacity: .7; }
.chip-x:hover { opacity: 1; }
@media (max-width: 760px) { .alert-hint { display: none; } }

/* ============================ PAGINATION ============================ */
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.pager .pages { display: flex; gap: 4px; }
.pager button { min-width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; cursor: pointer; color: var(--ink-2); padding: 0 8px; }
.pager button:hover:not(:disabled) { background: var(--bg); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ============================ MODAL ============================ */
.modal-back {
  position: fixed; inset: 0; background: rgba(16,24,40,.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 20px; animation: fadeIn .13s;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.w-lg { max-width: 860px; }
.modal.w-xl { max-width: 1080px; }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 15.5px; font-weight: 700; }
.modal-head .x { margin-left: auto; border: 0; background: var(--line-2); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--ink-3); }
.modal-body { padding: 20px; overflow: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; background: #fcfcfd; border-radius: 0 0 16px 16px; }

/* ============================ FORM ============================ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-hint { font-size: 11.5px; color: var(--ink-4); }
.req::after { content: " *"; color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; font-size: 13px; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.check.on { border-color: var(--brand); background: var(--brand-soft); }
.check-row { display: flex; gap: 8px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: 20px; background: #d0d5dd; transition: .18s; position: relative; }
.switch .track::after { content: ""; position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ============================ TOAST ============================ */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 9px; z-index: 400; max-width: 380px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 11px;
  padding: 12px 15px; box-shadow: var(--shadow-lg); font-size: 13px; animation: slideIn .2s; display: flex; gap: 10px;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: #f79009; }
.toast.info { border-left-color: var(--info); }
.toast b { display: block; margin-bottom: 2px; }

/* ============================ MISC BLOCKS ============================ */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-4); margin-bottom: 10px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--ink-4); }
.empty-state .ico { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; font-size: 8px; z-index: 1; }
.tl-item.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-item.current .tl-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(0, 52, 112,.15); }
.tl-body b { font-size: 13px; }
.tl-body small { color: var(--ink-4); font-size: 11.5px; }
.progress { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; }

.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 10px 4px 0; }
.chart-bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart-bars .bar .fill { width: 100%; max-width: 42px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #5b93cf, var(--brand)); min-height: 3px; transition: .3s; position: relative; }
.chart-bars .bar:hover .fill { filter: brightness(1.08); }
.chart-bars .bar span { font-size: 9.5px; color: var(--ink-4); white-space: nowrap; transform: scale(.96); }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

.msg-list { display: grid; gap: 10px; }
.msg { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.msg:hover { background: #fafbfc; }
.msg .av { width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-3); flex: 0 0 auto; }
.msg .b { flex: 1; min-width: 0; }
.msg .b b { font-size: 12.5px; }
.msg .b p { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .t { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 9px; max-height: 340px; overflow: auto; padding: 4px; }
.chat .line { display: flex; gap: 8px; }
.chat .line.me { justify-content: flex-end; }
.chat .bubble { max-width: 74%; padding: 8px 12px; border-radius: 13px; background: var(--line-2); font-size: 13px; }
.chat .line.me .bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat .line:not(.me) .bubble { border-bottom-left-radius: 4px; }
.chat .meta { font-size: 10px; color: var(--ink-4); margin-top: 3px; }

.qr-box { padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: #fcfcfd; text-align: center; }
.uploader { border: 1.5px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--ink-4); cursor: pointer; font-size: 13px; transition: .15s; }
.uploader:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }

/* ============================ CUSTOMER PORTAL ============================ */
.portal-customer { background: #f7f8fb; }
.c-head { background: #fff; border-bottom: 1px solid var(--line); }
.c-head-top { display: flex; align-items: center; gap: 18px; padding: 12px 26px; max-width: 1320px; margin: 0 auto; }
.c-rate {
  display: flex; align-items: center; gap: 9px; background: linear-gradient(90deg, #fff8f0, #fff);
  border: 1px solid #ffe6cc; border-radius: 10px; padding: 6px 12px; font-size: 12px; color: #a15c00;
}
.c-rate b { font-size: 13px; }
.c-rate marquee, .c-rate .tick { max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #b26a00; }
.c-head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.c-cart {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600;
}
.c-cart:hover { border-color: var(--brand); color: var(--brand); }
.c-cart .n { position: absolute; top: -7px; right: -7px; background: var(--brand); color: #fff; font-size: 10px; min-width: 18px; height: 18px; border-radius: 20px; display: grid; place-items: center; font-weight: 700; border: 2px solid #fff; }
.c-balance { text-align: right; line-height: 1.15; }
.c-balance small { font-size: 10.5px; color: var(--ink-4); display: block; }
.c-balance b { font-size: 14px; color: var(--brand); font-variant-numeric: tabular-nums; }
.c-nav { background: #fff; border-top: 1px solid var(--line-2); }
.c-nav-inner { max-width: 1320px; margin: 0 auto; display: flex; gap: 4px; padding: 0 20px; overflow-x: auto; }
.c-nav-inner a {
  padding: 11px 15px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2px solid transparent; cursor: pointer;
}
.c-nav-inner a:hover { color: var(--brand); }
.c-nav-inner a.on { color: var(--brand); border-bottom-color: var(--brand); }
.c-main { max-width: 1320px; margin: 0 auto; padding: 20px 26px 46px; }
.c-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 18px; align-items: start; }
/* Grid item khÃ´ng Ä‘Æ°á»£c phÃ©p rá»™ng hÆ¡n track (menu ngang trÃªn mobile cuá»™n trong khung) */
.c-layout > * { min-width: 0; }
.c-side { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; position: sticky; top: 14px; }
.c-side-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-4); }
.c-side a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.c-side a:hover { background: var(--bg); }
.c-side a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.c-side a .n { margin-left: auto; font-size: 10.5px; background: var(--line-2); padding: 0 6px; border-radius: 20px; color: var(--ink-3); }
.c-side a.on .n { background: #dce8f7; color: var(--brand); }
.c-banner {
  background: linear-gradient(90deg, #fff3e0, #fff9f0); border-bottom: 1px solid #ffe7c2;
  font-size: 12.5px; color: #a15c00; display: flex; align-items: center; gap: 10px; padding: 7px 26px; justify-content: center;
}
.c-banner .x { margin-left: 6px; border: 0; background: rgba(0,0,0,.06); border-radius: 6px; cursor: pointer; padding: 0 6px; }
.cart-shop { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; background: #fff; overflow: hidden; }
.cart-shop-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fcfcfd; border-bottom: 1px solid var(--line-2); }
.cart-line { display: grid; grid-template-columns: 32px 64px minmax(0,1fr) 140px 90px 120px; gap: 12px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--line-2); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); }
.cart-line .qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cart-line .qty button { width: 26px; height: 28px; border: 0; background: #fafbfc; cursor: pointer; }
.cart-line .qty input { width: 40px; border: 0; text-align: center; height: 28px; }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.steps .st { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-4); font-weight: 600; }
.steps .st b { width: 24px; height: 24px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-size: 12px; }
.steps .st.on { color: var(--brand); }
.steps .st.on b { background: var(--brand); color: #fff; }
.steps .st.done { color: var(--ok); }
.steps .st.done b { background: var(--ok); color: #fff; }
.steps .sep { flex: 1; height: 1px; background: var(--line); max-width: 60px; }
.pay-box { position: sticky; top: 14px; }
.pay-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--ink-2); }
.pay-row.total { font-size: 17px; font-weight: 800; color: var(--brand); border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }
@media (max-width: 1100px) {
  .c-layout { grid-template-columns: 1fr; }
  .c-side { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 6px; }
  .c-side-group { display: none; }
  .c-side a { white-space: nowrap; }
  .cart-line { grid-template-columns: 26px 52px minmax(0,1fr); }
  .cart-line > :nth-child(n+4) { grid-column: 3; }
}
.hero {
  background: linear-gradient(120deg, #1d5a9e 0%, #003470 55%, #001b3d 100%); color: #fff;
  border-radius: 18px; padding: 26px 28px; position: relative; overflow: hidden; margin-bottom: 18px;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero h2 { font-size: 24px; letter-spacing: -.5px; margin-bottom: 6px; }
.hero p { color: rgba(255,255,255,.85); font-size: 13.5px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero .chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); padding: 5px 11px; border-radius: 20px; font-size: 12px; cursor: pointer; }
.hero .chip:hover { background: rgba(255,255,255,.26); }
.c-stats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.c-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center;
  cursor: pointer; transition: .14s;
}
.c-stat:hover { border-color: var(--brand); box-shadow: 0 6px 18px -10px rgba(0, 52, 112,.5); transform: translateY(-2px); }
.c-stat .n { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.c-stat .l { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.c-foot { border-top: 1px solid var(--line); background: #fff; margin-top: 20px; }
.c-foot-inner { max-width: 1320px; margin: 0 auto; padding: 26px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 22px; font-size: 12.5px; color: var(--ink-3); }
.c-foot h4 { color: var(--ink); font-size: 13px; margin-bottom: 9px; }
.c-foot a:hover { color: var(--brand); }
.zalo-fab {
  position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%;
  background: #0068ff; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  box-shadow: 0 12px 24px -10px rgba(0,104,255,.9); cursor: pointer; z-index: 90; border: 0;
}
.zalo-fab:hover { transform: scale(1.06); }

/* ============================ RESPONSIVE ============================ */
.menu-toggle { display: none; }
@media (max-width: 1280px) {
  .c-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 992px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: .22s; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid; }
  /* thanh ngang thu về drawer dọc trên màn hình nhỏ */
  .app.nav-top { grid-template-columns: 1fr; grid-template-rows: auto; }
  .app.nav-top .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 272px; height: 100vh;
    flex-direction: column; align-items: stretch; border-bottom: 0;
    transform: translateX(-105%); transition: .22s;
  }
  .app.nav-top .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-top .sidebar-head { padding: 18px 18px 14px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .app.nav-top .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .app.nav-top .brand-text small { display: block; }
  .app.nav-top .sidebar-nav { display: block; flex: 1; padding: 10px 10px 24px; overflow-y: auto; }
  .app.nav-top .nav-group { position: static; }
  .app.nav-top .nav-group > .nav-title { font-size: 10.5px; padding: 9px 12px; }
  .app.nav-top .nav-items {
    position: static; display: grid; min-width: 0; max-height: none; overflow: visible;
    padding: 0; background: none; border: 0; box-shadow: none;
  }
  .app.nav-top .nav-link.active::before { display: block; }
  .app.nav-top .sidebar-foot { display: block; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .c-head-top { padding: 10px 14px; flex-wrap: wrap; }
  .c-rate { display: none; }
  .c-main { padding: 14px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .c-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box .input { min-width: 120px; }
  .filters { overflow-x: auto; flex-wrap: nowrap; }
  .filters .field { min-width: 135px; }
}
@media (max-width: 640px) {
  .c-foot-inner { grid-template-columns: 1fr; }
  .c-balance { display: none; }
  .kv { grid-template-columns: 1fr; gap: 3px; }
  .kv dt { font-size: 11.5px; margin-top: 7px; }
  .modal { max-width: 100%; }
  .user-chip b, .user-chip small { display: none; }
}

/* ============================ TÃC Vá»¤ KÃ Gá»¬I (cá»•ng khÃ¡ch) ============================ */
.kg-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.kg-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
  text-align: left; cursor: pointer; transition: .14s; display: grid; gap: 1px; font: inherit;
}
.kg-stat:hover { border-color: var(--brand); box-shadow: 0 6px 18px -10px rgba(0, 52, 112,.5); transform: translateY(-2px); }
.kg-stat.on { border-color: var(--brand); background: var(--brand-soft); }
.kg-stat .n { font-size: 21px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.kg-stat .l { font-size: 10.5px; color: var(--ink-3); }
.kg-stat.is-brand .n { color: var(--brand); }
.kg-stat.is-danger .n { color: var(--danger); }
.kg-stat.is-ok .n { color: var(--ok); }

.kg-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.kg-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.kg-tabs::-webkit-scrollbar { display: none; }
.kg-tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 20px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.kg-tab .cnt { font-size: 10.5px; background: var(--line-2); color: var(--ink-3); padding: 0 6px; border-radius: 20px; margin-left: 5px; }
.kg-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.kg-tab.on .cnt { background: rgba(255,255,255,.24); color: #fff; }

.kg-list { padding: 12px 14px; display: grid; gap: 10px; }
.kg-card { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.kg-card.s-danger { border-left-color: var(--danger); }
.kg-card.s-warn { border-left-color: #f79009; }
.kg-card.s-off { opacity: .72; }
.kg-card:hover { box-shadow: var(--shadow); }
.kg-top { display: flex; align-items: center; gap: 8px; padding: 9px 13px; background: #fcfcfd; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.kg-plat { font-size: 10.5px; font-weight: 800; letter-spacing: .2px; padding: 1px 7px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.kg-plat.p-taobao { background: #fff1e8; color: #c4320a; }
.kg-plat.p-tmall { background: #fef3f2; color: #c8102e; }
.kg-plat.p-1688 { background: #eff8ff; color: #175cd3; }
.kg-order { font-size: 12.5px; }
.kg-shop { font-size: 12px; color: var(--ink-3); }
.kg-mid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; padding: 12px 13px; }
.kg-name { font-size: 14px; font-weight: 700; }
.kg-qty { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kg-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.kg-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; text-align: right; }
.kg-clock { font-size: 11px; color: var(--ink-3); }
.kg-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.kg-steps { display: flex; margin-top: 12px; }
.kg-step { flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-4); position: relative; }
.kg-step i {
  display: grid; place-items: center; width: 18px; height: 18px; margin: 0 auto 4px; border-radius: 50%;
  background: var(--line-2); color: #fff; font-style: normal; font-size: 9px; position: relative; z-index: 1;
}
.kg-step:not(:last-child)::after {
  content: ""; position: absolute; top: 8px; left: calc(50% + 11px); width: calc(100% - 22px);
  height: 2px; background: var(--line-2);
}
.kg-step.done i { background: var(--ok); }
.kg-step.done::after { background: var(--ok); }
.kg-step.done span { color: var(--ink-2); }
.kg-step.cur i { background: var(--brand); box-shadow: 0 0 0 4px rgba(0, 52, 112,.14); }
.kg-step.cur span { color: var(--brand); font-weight: 700; }
.kg-steps-off { margin-top: 10px; }
.kg-cancel-note { font-size: 11.5px; color: var(--ink-4); }

.kg-answers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.kg-ans { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 9px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.kg-ans b { font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; opacity: .65; font-weight: 800; }
.kg-ans.t-ok { background: var(--ok-soft); color: #027a48; }
.kg-ans.t-warn { background: var(--warn-soft); color: var(--warn); }
.kg-ans.t-info { background: var(--info-soft); color: var(--info); }
.kg-ans.t-danger { background: var(--danger-soft); color: var(--danger); }
.kg-ans.t-off { background: var(--line-2); color: var(--ink-3); }

.kg-issues { padding: 9px 13px; border-top: 1px solid #fdeacb; background: #fffcf6; display: grid; gap: 4px; }
.kg-issue { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--warn); }
.kg-issue .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-top: 6px; flex: none; }
.kg-issue.i-danger { color: var(--danger); }
.kg-issue.i-info { color: var(--ink-3); }

.kg-empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.kg-empty .big { font-size: 38px; margin-bottom: 8px; }
.kg-empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.kg-tip { margin-top: 10px; font-size: 12px; color: var(--ink-3); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.kg-foot-note { padding: 10px 16px; font-size: 11.5px; color: var(--ink-4); background: #fcfcfd; border-top: 1px solid var(--line-2); }
.kg-page .card { border-radius: 14px; }

/* dashboard widget */
.kg-dash-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kg-mini { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.kg-mini:hover { border-color: var(--brand); }
.kg-mini b { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.kg-mini span { font-size: 11.5px; color: var(--ink-3); }
.kg-mini.is-brand b { color: var(--brand); }
.kg-mini.is-danger b { color: var(--danger); }
.kg-dash-list { margin-top: 12px; display: grid; gap: 6px; }
.kg-dash-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #fcfcfd; font-size: 12.5px; }
.kg-dash-row:hover { border-color: var(--brand); background: #fff; }
.kg-dash-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-dash-row b { color: var(--brand); font-size: 12px; white-space: nowrap; }

/* detail modal */
.kg-kv { grid-template-columns: 132px 1fr; }
.kg-h4 { font-size: 13px; margin: 18px 0 10px; }
.kg-timeline .tl-body small { display: block; }
.kg-detail-acts { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }

@media (max-width: 1100px) {
  .kg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kg-dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kg-mid { grid-template-columns: 1fr; }
  .kg-side { align-items: flex-start; text-align: left; }
  .kg-acts { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .kg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kg-dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kg-steps { margin-top: 10px; }
  .kg-step span { font-size: 9px; }
  .search-box .input { min-width: 0; }
}

/* zoom áº£nh phÃ¢n loáº¡i khi rÃª chuá»™t */
.zoom-pop{position:fixed;z-index:99999;pointer-events:none;border-radius:14px;overflow:hidden;background:#fff;
  border:1px solid #e6e8ee;box-shadow:0 24px 56px -16px rgba(16,24,40,.45);padding:5px}
.zoom-pop img{display:block;width:258px;height:258px;object-fit:cover;border-radius:10px}
[data-zoom]{cursor:zoom-in}

/* =====================================================================
   CHỌN NHIỀU DÒNG + THANH TÁC VỤ HÀNG LOẠT (listView.selectable)
   ===================================================================== */
.bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px;
  background: #eef4fc; border-bottom: 1px solid #d4e3f7; position: sticky; top: 0; z-index: 5;
}
.bulkbar[hidden] { display: none; }
.bulkbar .bulk-count { font-size: 12.5px; color: var(--brand); white-space: nowrap; }
.bulkbar .bulk-count b { font-size: 15px; }
table.tb th.sel-col, table.tb td.sel-col { width: 40px; padding-left: 14px; padding-right: 0; }
table.tb input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
table.tb tbody tr.selected td { background: #f3f7fe; }
table.tb tbody tr.selected:hover td { background: #ecf2fd; }

/* =====================================================================
   PHÂN ĐƠN — bảng tải công việc GDV + chọn đơn
   ===================================================================== */
.assign-split { display: grid; grid-template-columns: minmax(0, 1fr) 364px; gap: 16px; align-items: start; }
.assign-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin-bottom: 16px; }
.assign-kpis .kg-stat { padding: 11px 13px; }
.assign-kpis .kg-stat.is-warn .n { color: var(--warn); }
.assign-kpis .kg-stat.is-plain .n { color: var(--ink); }

.gdv-board { padding: 10px 12px; display: grid; gap: 8px; max-height: 620px; overflow: auto; }
.gdv-row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  cursor: pointer; transition: .12s;
}
.gdv-row:hover { border-color: #c9d6e8; box-shadow: 0 4px 14px -10px rgba(0, 52, 112, .55); }
.gdv-row.on { border-color: var(--brand); background: var(--brand-soft); }
.gdv-row .nm { font-size: 12.5px; font-weight: 700; line-height: 1.25; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gdv-row .sub { font-size: 11px; color: var(--ink-4); }
.gdv-load { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; margin-top: 5px; }
.gdv-load i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #5b93cf, #003470); }
.gdv-load.warn i { background: linear-gradient(90deg, #fdb022, #dc6803); }
.gdv-load.full i { background: linear-gradient(90deg, #f97066, #d92d20); }
.gdv-mini { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.gdv-mini span { font-size: 10.5px; padding: 1px 6px; border-radius: 20px; background: var(--line-2); color: var(--ink-2); }
.gdv-mini span.warn { background: var(--danger-soft); color: #b42318; }
.gdv-ops { display: grid; gap: 4px; justify-items: end; }
.gdv-board-foot { padding: 10px 14px; border-top: 1px solid var(--line-2); background: #fcfcfd; font-size: 11.5px; color: var(--ink-4); }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 4px 0 8px; }

/* chọn GDV trong modal */
.staff-pick { display: grid; gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.staff-pick label {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; cursor: pointer; background: #fff;
}
.staff-pick label:hover { border-color: #c9d6e8; }
.staff-pick label.on { border-color: var(--brand); background: var(--brand-soft); }
.staff-pick input { accent-color: var(--brand); width: 16px; height: 16px; }
.staff-pick .nm { font-weight: 700; font-size: 12.5px; }
.staff-pick .ld { font-size: 11px; color: var(--ink-4); }
.staff-pick .ld b { color: var(--ink-2); }

/* xem trước phương án chia đơn */
.plan-tb td, .plan-tb th { padding: 7px 10px; font-size: 12px; }
.plan-bar { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; min-width: 70px; }
.plan-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5b93cf, #003470); }

/* =====================================================================
   WORKFLOW MUA HÀNG (màn hình GDV)
   ===================================================================== */
.wf-card .steps { margin-bottom: 12px; flex-wrap: wrap; }
.wf-next {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px;
  border-radius: 12px; background: linear-gradient(90deg, #f2f7ff, #fbfdff); border: 1px solid #d6e4f5;
}
.wf-next .ttl { font-size: 11px; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: .5px; }
.wf-next .hint { font-size: 12.5px; color: var(--ink-2); }
.wf-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.wf-card .steps .st.done { color: var(--ok); }
.inbox-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px;
  border-radius: 12px; background: linear-gradient(90deg, #eef4fc, #f8fbff); border: 1px solid #d6e4f5; margin-bottom: 12px;
}
.inbox-strip .n { font-size: 21px; font-weight: 800; color: var(--brand); line-height: 1; }
.inbox-strip .l { font-size: 10.5px; color: var(--ink-3); }
.inbox-strip .is-danger .n, .inbox-strip .n.is-danger { color: var(--danger); }

.checklist { display: grid; gap: 6px; }
.ck {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 12px; background: #fff;
}
.ck .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: var(--warn-soft); color: var(--warn); }
.ck.ok .ic { background: var(--ok-soft); color: var(--ok); }
.ck.na .ic { background: var(--line-2); color: var(--ink-4); }
.ck .lb { color: var(--ink-2); font-weight: 600; }
.ck .lb small { display: block; font-weight: 400; color: var(--ink-4); font-size: 10.5px; }
.ck .go { border: 0; background: none; color: var(--info); font-size: 11px; cursor: pointer; font-weight: 600; }
.ck.ok .go { visibility: hidden; }

/* nhấp nháy ô cần bổ sung khi bấm “Bổ sung” trong checklist */
.input-flash { animation: inputFlash 1.4s ease; }
@keyframes inputFlash {
  0%, 100% { box-shadow: none; }
  18%, 62% { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(241, 120, 0, .22); }
}
/* thanh thao tác dính đáy màn mua hàng */
[data-bar] { box-shadow: 0 14px 32px -14px rgba(16, 24, 40, .45); }

@media (max-width: 1280px) {
  .assign-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .assign-split { grid-template-columns: 1fr; }
  .gdv-board { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .assign-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gdv-board { grid-template-columns: 1fr; }
  .inbox-strip { gap: 10px; }
  .wf-actions { margin-left: 0; width: 100%; }
}

