:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #03123a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0050c8;
  --brand-2: #1a73e8;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.block { display: block; width: 100%; }
.danger { color: var(--bad) !important; font-weight: 600; }
.hidden { display: none !important; }

/* ---------- Đăng nhập ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(26, 115, 232, .25), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(0, 80, 200, .3), transparent 60%),
    #03123a;
}
.login:not(.hidden) { display: grid; }
.login-card {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  display: grid;
  gap: 14px;
}
.login-card h1 { font-size: 24px; margin-top: 8px; }

/* ---------- Thương hiệu ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; }
.brand-lg { color: var(--ink); font-size: 17px; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; overflow: hidden;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #0050c8, #1a73e8 55%, #60a5fa);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.logo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; display: block; }

/* ---------- Khung chính ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #03123a 0%, #0a2a7a 100%);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 24px;
}
.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #cbd5e1; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #a5b4fc; }
.nav-item .ico { width: 20px; text-align: center; opacity: .9; }
.badge {
  margin-left: auto; min-width: 22px; padding: 0 7px; height: 20px; line-height: 20px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; text-align: center;
}
.me {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .06);
  color: #fff;
}
.me small { display: block; color: #94a3b8; }
.me .link { margin-left: auto; background: none; border: 0; color: #a5b4fc; cursor: pointer; font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px;
  background: rgba(244, 246, 251, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar p { margin: 2px 0 0; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 24px 28px 48px; display: grid; gap: 20px; }

/* ---------- Nút & ô nhập ---------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600;
  background: var(--card); color: var(--ink-2); border-color: var(--line);
  transition: transform .05s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  color: #fff; border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(0, 80, 200, .3);
}
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #fecaca; background: #fff; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.icon-btn { background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); }
.link { background: none; border: 0; cursor: pointer; }

input, select, textarea {
  font: inherit; color: var(--ink);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 80, 200, .15);
}
textarea { resize: vertical; }
.select { width: auto; min-width: 180px; padding: 9px 12px; }
.search { max-width: 360px; }
.field { display: grid; gap: 6px; font-weight: 500; color: var(--ink-2); }
.field > span em { color: var(--bad); font-style: normal; }
.field.full, .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink-2); }
.check input { width: auto; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.error { color: var(--bad); min-height: 20px; margin: 0; }

/* ---------- Thẻ, bảng, pill ---------- */
.panel, .kpi, .shop-card, .table-wrap {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel { padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head a { font-size: 13px; font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (min-width: 1100px) { .kpis.kpis-5 { grid-template-columns: repeat(5, 1fr); } }
.kpi { padding: 18px 20px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.kpi.warn::before { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.kpi span { color: var(--muted); font-weight: 500; font-size: 13px; }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }

.row-item, .task, .act {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-bottom: 1px solid var(--line);
}
.row-item:last-child, .task:last-child, .act:last-child { border-bottom: 0; }
.row-item { cursor: pointer; border-radius: 10px; }
.row-item:hover { background: var(--bg); }
.row-item > div:first-child { flex: 1; display: grid; min-width: 0; }
.row-item strong, .task-title { font-weight: 600; }

.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 14px; align-items: center; padding: 6px 0; }
.bar-label { display: grid; }
.bar { height: 10px; background: #eef2ff; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; }
.bar-row b { font-variant-numeric: tabular-nums; }

.act small { display: block; }
.act b { font-weight: 600; }

.pill {
  --c: #64748b;
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, white);
}
.pill.blue { --c: #2563eb; }
.pill.green { --c: #059669; }
.pill.red { --c: #dc2626; }
.pill.gray { --c: #64748b; }
.pill.purple { --c: #1a73e8; }
.etsy-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; font-size: 13px; }
.etsy-why { margin: -2px 0 8px; line-height: 1.45; }
.etsy-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.copy-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.copy-line code, .copy-line input { flex: 1; min-width: 200px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; color: inherit; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
pre.raw { margin: 8px 0 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; font-size: 11.5px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.tag {
  display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px;
  border-radius: 6px; background: #eef2ff; color: #4338ca; font-size: 12px; font-weight: 500;
}

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #c7d2fe, #ddd6fe);
  color: #3730a3; font-size: 11px; font-weight: 700;
}
.avatar.sm { width: 26px; height: 26px; }
.user-cell { display: flex; align-items: center; gap: 10px; }

.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 12px; }
.empty-col { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed #cbd5e1; border-radius: 12px; }

/* ---------- Bảng ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
td strong { font-weight: 600; }
td .block { display: block; }
.prio {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  font-weight: 700; font-size: 12px; color: #fff;
}
.pA { background: #059669; }
.pB { background: #2563eb; }
.pC { background: #94a3b8; }

.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stage {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
}
.stage span { color: var(--muted); font-weight: 500; }
.stage b { font-size: 20px; }

/* ---------- Kanban đơn hàng ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col {
  background: #e9eef6; border-radius: var(--radius); padding: 12px;
  display: grid; align-content: start; gap: 10px; min-height: 420px;
  transition: background .15s, outline-color .15s;
  outline: 2px dashed transparent; outline-offset: -4px;
}
.col.over { background: #e0e7ff; outline-color: var(--brand); }
.col > header { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 2px 4px 6px; }
.col > header small { margin-left: auto; font-weight: 600; color: var(--ink-2); }
.col .dot { width: 9px; height: 9px; border-radius: 50%; }
.count { background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--ink-2); }
.card-item {
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); cursor: grab; display: grid; gap: 6px;
  border: 1px solid transparent; transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative;
}
.card-item:hover { transform: translateY(-2px); border-color: #c7d2fe; }
.card-item:active { cursor: grabbing; }
.ci-title { font-weight: 600; padding-right: 30px; }
.ci-sub { color: var(--muted); font-size: 12px; }
.ci-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.ci-foot strong { color: var(--ink); font-size: 14px; }
.card-item .avatar { position: absolute; top: 10px; right: 10px; }

/* ---------- Công việc ---------- */
.task { padding: 12px 8px; border-radius: 10px; }
.task:hover { background: #fafbff; }
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex: none; }
.task-main { flex: 1; cursor: pointer; min-width: 0; display: grid; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }

/* ---------- Shop ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.shop-card { padding: 20px; display: grid; gap: 14px; align-content: start; }
.shop-top { display: flex; align-items: center; gap: 12px; }
.shop-top > div:nth-child(2) { flex: 1; min-width: 0; }
.shop-top h3 { margin-bottom: 2px; }
.shop-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #f97316, #f43f5e); color: #fff; font-weight: 800;
}
.shop-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f8fafc; border-radius: 12px; padding: 12px; }
.shop-stats span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.shop-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fade .15s ease;
}
.modal-card {
  width: min(680px, 100%); max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: 18px; padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  animation: pop .18s ease;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#modalForm { display: grid; gap: 16px; }
#modalForm .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-actions > div { display: flex; gap: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  padding: 12px 16px; border-radius: 12px; color: #fff; font-weight: 600;
  background: var(--ink); box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
  transform: translateY(140%); opacity: 0; transition: transform .25s, opacity .25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok { background: #065f46; }
.toast.bad { background: #991b1b; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .stages { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; }
  .nav { grid-auto-flow: column; overflow-x: auto; }
  .me { margin-top: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; padding: 16px; }
  .content { padding: 16px; }
  #modalForm .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Chấm công ---------- */
.attend-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.attend-card h2 { margin: 4px 0; font-size: 22px; }
.attend-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.big { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------- Listing: ảnh và thao tác ---------- */
.listing-cell { display: flex; align-items: center; gap: 10px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); flex: none; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* Xem trước ảnh listing theo thứ tự */
.listing-strips { margin-top: 8px; display: grid; gap: 8px; }
.strip-row { display: flex; gap: 8px; align-items: flex-start; }
.strip-label { font-size: 12px; color: var(--muted, #6b7280); min-width: 56px; padding-top: 22px; }
.strip { display: flex; gap: 6px; flex-wrap: wrap; }
.strip-item { width: 76px; text-align: center; }
.strip-item img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line, #e5e7eb); display: block; }
.strip-item small { font-size: 11px; }
.strip-btns { display: flex; justify-content: center; gap: 2px; margin-top: 3px; }
.strip-btns .btn { padding: 2px 6px; font-size: 11px; }

/* Chỉnh bố cục dãy ảnh: ô rộng hơn, nút không xuống dòng */
.strip-item { width: 100px; }
.strip-item img { width: 100px; height: 100px; }
.strip-item .strip-meta { display: block; font-size: 11px; line-height: 1.3; white-space: nowrap; }
.strip-item .strip-meta.muted { color: var(--muted, #6b7280); }

/* Bảng listing: kẻ đường dọc và ngang cho từng ô, nội dung căn trên */
.listing-table th, .listing-table td { border: 1px solid #e6ebf3; vertical-align: top; }
.listing-table td { padding: 10px 12px; }
.listing-table th { padding: 10px 12px; }
.listing-table tbody tr:last-child td { border-bottom: 1px solid #e6ebf3; }
.listing-table td { word-break: break-word; }
/* Cột Thao tác luôn nằm sát mép phải để bấm được Sửa, Xóa dù bảng rộng */
.listing-table th:last-child { background: #f8fafc; }
.listing-table .strip-row { display: block; }
.listing-table .strip-label { display: none; }
.listing-table .strip { display: flex; flex-wrap: wrap; gap: 4px; max-width: 200px; }
.listing-table .strip-item { width: 17px; }
.listing-table .strip-item img { width: 17px; height: 17px; border-radius: 2px; }
.listing-table .strip-item .strip-meta { font-size: 8px; line-height: 1; }
.listing-table .strip-item .strip-btns { display: flex; gap: 1px; justify-content: center; }
.listing-table .strip-item .strip-btns .btn { padding: 0 2px; font-size: 8px; min-width: 0; }
.listing-table td { padding: 8px 10px; }
.listing-table .lst-line { white-space: nowrap; line-height: 1.5; }
.listing-table .tag-full { font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.listing-table .copy-cell { display: block; cursor: pointer; border-radius: 4px; }
.listing-table .copy-cell:hover, .listing-table .copy-cell:focus-visible { color: #1a73e8; background: #eef4ff; outline: none; }
.listing-table strong.copy-cell { display: block; }

/* Cố định độ rộng từng cột để tiêu đề không bị ép thành từng chữ một */
.listing-table { table-layout: fixed; width: max-content; min-width: 100%; }
.listing-table th, .listing-table td { overflow-wrap: anywhere; }
.listing-table th:nth-child(1), .listing-table td:nth-child(1) { width: 100px; }
.listing-table th:nth-child(2), .listing-table td:nth-child(2) { width: 110px; }
.listing-table th:nth-child(3), .listing-table td:nth-child(3) { width: 230px; }
.listing-table th:nth-child(4), .listing-table td:nth-child(4) { width: 180px; }
.listing-table th:nth-child(5), .listing-table td:nth-child(5) { width: 160px; }
.listing-table th:nth-child(6), .listing-table td:nth-child(6) { width: 160px; }
.listing-table th:nth-child(7), .listing-table td:nth-child(7) { width: 120px; }
.listing-table th:nth-child(8), .listing-table td:nth-child(8) { width: 205px; }
.listing-table th:nth-child(9), .listing-table td:nth-child(9) { width: 110px; }
.listing-table th:nth-child(10), .listing-table td:nth-child(10) { width: 100px; }
.listing-table th:nth-child(11), .listing-table td:nth-child(11) { width: 100px; }
.listing-table th:nth-child(12), .listing-table td:nth-child(12) { width: 170px; }
.listing-table th:nth-child(13), .listing-table td:nth-child(13),
.listing-table th:nth-child(14), .listing-table td:nth-child(14),
.listing-table th:nth-child(15), .listing-table td:nth-child(15) { width: 110px; }
.listing-table td:nth-child(3) { max-width: none; }
.listing-table td:nth-child(3) .listing-cell { align-items: flex-start; gap: 8px; }
.listing-table td:nth-child(3) strong { font-size: 13px; line-height: 1.3; display: block; }
.listing-table td:nth-child(3) small { font-size: 11px; }
.listing-table .thumb { width: 32px; height: 32px; border-radius: 6px; }
.listing-table .strip-item .strip-meta { font-size: 9px; line-height: 1.1; }
.listing-table .strip-item .strip-btns .btn { padding: 0 3px; font-size: 9px; }
.listing-table .zoomable { cursor: zoom-in; }

/* Xem ảnh to */
.img-viewer { position: fixed; inset: 0; background: rgba(15, 23, 42, .88); display: none; align-items: center; justify-content: center; z-index: 1000; }
.img-viewer.open { display: flex; }
.iv-img { max-width: 86vw; max-height: 84vh; object-fit: contain; border-radius: 8px; background: #fff; }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); font-size: 28px; line-height: 1; cursor: pointer; }
.iv-nav:disabled { opacity: .3; cursor: default; }
.iv-prev { left: 20px; }
.iv-next { right: 20px; }
.iv-close { position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); font-size: 26px; line-height: 1; cursor: pointer; }
.iv-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 999px; }
.listing-table .listing-cell > div { min-width: 0; }
.listing-table .listing-strips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; max-width: 260px; }
.listing-table .strip-item, .listing-table .strip-item img { width: 64px; }
.listing-table .strip-item img { height: 64px; }
.listing-table .strip-item .strip-btns { display: flex; }
.listing-table .strip-item .strip-btns .btn { padding: 1px 4px; font-size: 10px; }
.listing-table .cell-more { max-width: 200px; }
.listing-table .cell-more summary { cursor: pointer; overflow-wrap: anywhere; }
.listing-table .cell-full { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.listing-table td .btn.small { padding: 4px 8px; }
.strip-btns { flex-wrap: nowrap; gap: 3px; justify-content: center; }
.strip-btns .btn { padding: 2px 0; min-width: 26px; font-size: 11px; line-height: 1.4; }

/* Menu bên trái chia nhóm theo nghiệp vụ */
.nav-group { display: grid; gap: 4px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .45); padding: 0 12px 4px; }
@media (max-width: 900px) {
  .nav-group { display: contents; }
  .nav-title { display: none; }
}

/* Nút thu gọn menu */
.nav-toggle { margin-left: auto; background: transparent; border: 0; color: rgba(255, 255, 255, .7); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nav-toggle:hover { color: #fff; background: rgba(255, 255, 255, .08); }
body.nav-collapsed .sidebar { width: 76px; }
body.nav-collapsed .brand > span:not(.logo),
body.nav-collapsed .nav-title,
body.nav-collapsed .nav-item > span:not(.ico),
body.nav-collapsed .nav-item .badge,
body.nav-collapsed .me > div,
body.nav-collapsed .me .link { display: none; }
body.nav-collapsed .nav-item { justify-content: center; }
body.nav-collapsed .nav-toggle { transform: rotate(180deg); }

/* Trang tự đánh giá */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.review-card { padding: 16px; }
.review-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.review-metrics > div { background: var(--soft, #f5f6fa); border-radius: 10px; padding: 10px 12px; }
.review-metrics strong { display: block; font-size: 20px; }
.review-check { font-size: 13px; margin: 0; }
.review-pass { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.review-pass label { display: grid; gap: 6px; font-size: 13px; }
.review-pass input { padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }

/* Bảng chỉ số */
.review-sub { margin: 18px 0 10px; font-size: 15px; }
.review-period { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.review-period select { padding: 6px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.text-bad { color: #b91c1c; font-weight: 600; }

/* Thanh tiến độ theo nhân viên */
.bar { height: 8px; background: var(--soft, #eef0f5); border-radius: 99px; overflow: hidden; margin-bottom: 4px; min-width: 120px; }
.bar span { display: block; height: 100%; background: var(--brand, #0050c8); }

/* ---------- Tiện ích hiển thị (v1.3) ---------- */
.num-col { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.empty-compact { padding: 12px 16px; border: 1px dashed #cbd5e1; border-radius: 12px; color: var(--muted); font-size: 13px; }
.review-period { white-space: nowrap; }

/* Chọn khoảng ngày tùy chọn trên thanh kỳ xem */
.period-range { display: inline-flex; align-items: center; gap: 6px; }
.period-range input[type="date"] { height: 30px; padding: 0 8px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }

/* Ô tìm kiếm trên bảng đơn hàng */
.order-search { width: 340px; max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }

/* Cảnh báo hạn sắp tới (trong 48 giờ) trên bảng đơn */
.warn-text { color: #b45309; font-weight: 600; }

/* Cập nhật nhanh trên bảng đơn */
.order-quick { white-space: nowrap; }
#orderWrap .col-sku { max-width: 120px; word-break: break-all; }
#orderWrap .col-sku .sku-code { font-size: 10px; padding: 1px 4px; }
#orderWrap .col-shop { max-width: 110px; font-size: 12px; }
#orderWrap .col-status { min-width: 170px; }
#orderWrap .col-status select { width: auto; min-width: 150px; height: 34px; font-size: 14px; font-weight: 600; padding: 0 10px; }
.order-quick select, .order-quick input { height: 30px; font: inherit; font-size: 12px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; padding: 0 6px; margin-right: 4px; }
.order-quick input { width: 120px; }

/* Thanh công cụ bảng đơn: tìm + trạng thái bên trái, bộ lọc gọn bên phải */
.order-bar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.order-bar-left, .order-bar-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.order-bar-right { justify-content: flex-start; }
.order-bar-right select, .order-bar-right input[type="date"] { font-size: 13px; padding: 4px 6px; width: auto; min-width: 130px; height: 32px; }
.order-bar-right .period-range input[type="date"] { min-width: 0; width: 140px; }
.order-bar .btn.small { padding: 4px 9px; }
.order-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.alert-chip { font: inherit; font-size: 12px; font-weight: 400; color: #334155; padding: 5px 10px; border-radius: 8px; background: #fff; cursor: pointer; border: 1px solid #E2E8F0; border-left-width: 3px; display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-align: left; }
.alert-chip b { font-variant-numeric: tabular-nums; flex-shrink: 0; font-weight: 700; }
.alert-chip.danger { border-left-color: #dc2626; color: #991b1b; }
.alert-chip.warn { border-left-color: #d97706; color: #92400e; }
.alert-chip.zero { opacity: .5; }
.alert-chip.on { background: #1E293B; color: #fff; border-color: #1E293B; }

/* ---------- Tinh chỉnh giao diện ---------- */
.card, .shop-card, .cards > * {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.shop-card:hover, .cards > .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .10);
}
.nav-item { transition: background .15s ease, color .15s ease; }
.btn { transition: transform .12s ease, box-shadow .15s ease, background .15s ease; }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(0, 80, 200, .3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Đơn: cột SKU và ghi chú khách ---------- */
.sku-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #e8f0fe; color: var(--brand); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.note-col { min-width: 320px; max-width: 440px; white-space: normal; }
.note-line { display: block; margin-bottom: 4px; line-height: 1.45; }
.addr-block { margin-top: 4px; line-height: 1.4; }

.file-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.file-link { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.file-x { border: 0; background: transparent; color: var(--bad, #dc2626); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.file-x:hover { background: rgba(220, 38, 38, 0.1); border-radius: 4px; }

.order-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 0; color: var(--muted, #64748b); font-size: 13px; }
.order-pager .btn:disabled { opacity: 0.4; cursor: default; }

.order-scroll-top { overflow-x: auto; overflow-y: hidden; height: 14px; margin: 0 0 6px; }
.order-scroll-top > div { height: 1px; }

.sources { display: grid; gap: 6px; border-top: 1px dashed var(--line, #e2e8f0); padding-top: 10px; }
.src-row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: 13px; }
.src-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.cust-field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.cust-field { cursor: copy; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; max-width: 260px; }
.cust-field:hover { border-color: var(--brand, #2563eb); background: #f8fafc; }
.cust-val { display: block; font-size: 12px; line-height: 1.4; color: #1E293B; white-space: normal; }

.order-open { cursor: pointer; }
.order-open:hover strong { text-decoration: underline; }

.tg-block { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed #E2E8F0; padding-top: 8px; }
.tg-block input[type="password"], .tg-block input:not([type="checkbox"]) { font-size: 13px; padding: 6px 8px; }

/* ---------- Tinh chỉnh giao diện (giữ nguyên bảng màu) ---------- */
th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc;
  font-size: 11px; letter-spacing: .04em;
  padding: 11px 14px;
}
td { padding: 12px 14px; line-height: 1.45; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f5f8ff; }
.table-wrap { border-radius: var(--radius); scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.topbar { border-bottom: 1px solid var(--line); }
.toolbar { flex-wrap: wrap; align-items: center; }
.search:focus, .btn:focus-visible, .nav-item:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.btn { transition: box-shadow .15s ease, transform .1s ease, background .15s ease; }

.panel, .kpi, .shop-card { border: 1px solid #eef2f7; }
.kpi strong { font-variant-numeric: tabular-nums; }
.pill, .tag { white-space: nowrap; }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 40px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* ---------- Đợt 2: dễ nhìn hơn, vẫn giữ màu ---------- */
/* Nút và ô nhập đồng bộ kích thước */
.btn { height: 36px; border-radius: 10px; font-weight: 600; letter-spacing: .01em; }
.btn.small { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
input, select, textarea { border-radius: 10px; min-height: 36px; }

/* Thanh lọc đơn hàng: gọn, thẳng hàng, nhóm rõ */
#orderWrap .toolbar, .order-bar { gap: 8px; }
.order-bar-left { row-gap: 8px; }
.order-bar-left .btn.small { font-weight: 600; }
.order-bar-left .btn.small b { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: .85; }
.order-bar-left .btn.ghost { background: #fff; border-color: #dbe3ee; color: var(--ink-2); }
.order-bar-left .btn.ghost:hover { border-color: #93c5fd; color: var(--brand); }

/* Chip cảnh báo: rõ số, nhãn dễ đọc */
.order-alerts { gap: 8px; margin-top: 4px; }
.alert-chip {
  min-height: 34px; padding: 6px 12px; border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.alert-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.alert-chip b { font-size: 14px; }

/* Bảng đơn: tên đậm, phụ chú nhạt, dễ quét mắt */
tbody td { font-size: 13px; }
tbody td strong { color: var(--ink); font-size: 13.5px; }
tbody td small { line-height: 1.4; }
#orderWrap tbody tr td:first-child { font-variant-numeric: tabular-nums; }
#orderWrap .col-shop strong { font-size: 12.5px; letter-spacing: .02em; }

/* Thanh bên: nhóm mục rõ ràng, chữ dễ đọc */
.sidebar { padding: 18px 12px; }
.nav-group-title, .nav h4, .nav .group { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.nav-item { height: 38px; border-radius: 10px; font-size: 13.5px; font-weight: 500; }
.nav-item.active { font-weight: 600; }

/* Tiêu đề trang và khối số liệu */
.topbar h2 { font-size: 20px; }
.topbar p { font-size: 13px; color: var(--muted); }
.kpi { border-radius: 16px; padding: 18px 20px; }
.kpi span { font-size: 12.5px; text-transform: none; }
.kpi strong { font-size: 26px; }

/* Tag và pill rõ hơn */
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.order-bar-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-top: 4px; }
.order-bar-label .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.order-bar-left .order-bar-label { margin: 0 4px 0 6px; }

/* Thanh lọc đơn gọn lại: cảnh báo có số đơn, nút gom mục 0 đơn */
.order-alerts { grid-template-columns: repeat(auto-fill, minmax(200px, max-content)); }
.alert-chip { justify-content: space-between; gap: 14px; background: #fff; }
.alert-chip.more { border-style: dashed; color: var(--muted); background: transparent; font-weight: 600; }
.alert-chip.more:hover { color: var(--brand); border-color: #93c5fd; }
.order-bar-left { gap: 8px; }
.order-bar > .order-bar-label + .order-alerts { margin-top: 0; }

/* ===== Đợt làm đẹp: chữ, khoảng cách, màu, nút, bảng (giữ nguyên bố cục và bảng màu) ===== */

/* 1. Chữ: tiêu đề rõ, nội dung chính đậm hơn, phụ nhạt hơn */
body { font-size: 14px; line-height: 1.55; }
h2 { font-size: 24px; letter-spacing: -.02em; }
.topbar h2 { font-size: 22px; }
.topbar p { font-size: 13.5px; }
td strong, tbody td strong { font-weight: 650; color: var(--ink); }
td small, .muted, small { color: #6b7a90; }
th { color: #475569; font-weight: 700; }

/* 2. Khoảng cách: thoáng hơn giữa các khối */
.content { gap: 24px; padding: 28px 32px 56px; }
.panel { padding: 20px 22px; gap: 14px; }
.kpis { gap: 18px; }
.kpi { padding: 20px 22px; }
.toolbar { gap: 14px; margin-bottom: 4px; }
.order-bar { gap: 10px; margin-bottom: 12px; }
.order-bar-left, .order-bar-right { gap: 8px; }
.order-alerts { gap: 8px; }

/* 3. Màu: bớt viền lặp, chỉ tô màu ở chỗ cần chú ý */
.panel, .kpi, .shop-card, .table-wrap { border-color: #e6ebf3; box-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 2px 10px rgba(15, 23, 42, .04); }
.kpi::before { height: 2px; opacity: .85; }
.kpi.warn::before { opacity: .6; }
.pill { font-weight: 600; }
.tag { background: #f1f5f9; color: #334155; border: 0; }
tbody tr:hover { background: #f7f9fd; }
td { border-bottom-color: #eef2f7; }

/* 4. Nút và ô chọn: cùng kích thước, nút chính nổi rõ, nút phụ nhẹ */
.btn { height: 38px; border-radius: 10px; padding: 0 16px; font-weight: 600; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.ghost { background: #fff; border-color: #dbe3ee; color: var(--ink-2); }
.btn.ghost:hover { border-color: #93c5fd; color: var(--brand); }
.btn.primary { box-shadow: 0 1px 2px rgba(0, 80, 200, .25); }
.btn.primary:hover { box-shadow: 0 4px 12px rgba(0, 80, 200, .25); }
select, input[type="search"], input[type="date"] { border-color: #dbe3ee; }

/* 5. Bảng: dòng cao hơn, số căn phải, trạng thái căn giữa */
td { padding: 14px 16px; }
th { padding: 12px 16px; }
td .pill, td .badge { vertical-align: middle; }
.num-col, td.num { text-align: right; font-variant-numeric: tabular-nums; }
#orderWrap td { font-size: 13.5px; }
#orderWrap .col-status { text-align: left; }

/* ===== Thanh lọc đơn: chữ to, đậm, đổi màu ===== */
.order-bar .btn.small,
.order-bar-left .btn.small {
  height: 36px; padding: 0 14px; font-size: 14px; font-weight: 800;
  background: #eaf1ff; border: 1px solid #b9cdf2; color: #03123a; border-radius: 10px;
}
.order-bar .btn.small:hover { background: #d9e7ff; border-color: #0050c8; color: #0050c8; }
.order-bar .btn.small.primary,
.order-bar-left .btn.small.primary { background: #0050c8; border-color: #0050c8; color: #fff; }
.order-bar .btn.small b { font-size: 14px; font-weight: 800; }
.order-bar-label { font-size: 13px; font-weight: 800; color: #0050c8; letter-spacing: .06em; }

.order-alerts .alert-chip {
  font-size: 14px; font-weight: 800; min-height: 40px; padding: 8px 14px;
  background: #f5f8ff; color: #03123a; border: 1px solid #c9d8f3; border-left-width: 4px;
}
.order-alerts .alert-chip b { font-size: 16px; font-weight: 900; }
.order-alerts .alert-chip.danger { color: #9f1239; background: #fff1f3; border-color: #fbcfe0; border-left-color: #e11d48; }
.order-alerts .alert-chip.warn { color: #7c4a03; background: #fff8e6; border-color: #fde7b0; border-left-color: #f59e0b; }
.order-alerts .alert-chip.zero { opacity: 1; }
.order-alerts .alert-chip.more { font-size: 13px; font-weight: 700; color: #0050c8; background: #fff; border-color: #0050c8; }
.order-alerts .alert-chip.on { background: #0050c8; border-color: #0050c8; color: #fff; }

.order-bar-right select, .order-bar-right input[type="date"] { font-size: 14px; font-weight: 700; color: #03123a; height: 36px; }
.order-bar-right .period-range input[type="date"] { font-size: 14px; }
.order-bar-right select { border-color: #b9cdf2; background: #fff; }
.order-bar input.order-search, .order-bar-left input[type="search"] { font-size: 14px; font-weight: 700; height: 36px; border-color: #b9cdf2; color: #03123a; }
.design-select { height: 32px; font-size: 13px; font-weight: 600; min-width: 130px; border-radius: 8px; border: 1px solid #b9cdf2; background: #fff; color: #03123a; padding: 0 8px; }

.listing-table .ref-line { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; max-width: 260px; }
.listing-table .ref-line input { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid #d0d5dd; border-radius: 4px; }
.listing-table .ref-line a { text-decoration: none; }
.form-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: #eef4ff; color: #1f3a68; font-size: 13px; line-height: 1.5; }

/* Ô trống có thể sửa: hiện gợi ý thay vì dấu gạch, để người dùng biết bấm đúp được */
.empty-edit { display: inline-block; padding: 3px 8px; border: 1px dashed #9aa4b2; border-radius: 6px; color: #5b6676; font-size: 12px; cursor: text; }
.listing-table td:hover .empty-edit { border-color: #1a73e8; color: #1a73e8; }

/* Ảnh mockup/ideal trong bảng: thu nhỏ còn khoảng 1/4 diện tích; nút ◀ ▶ × hiện khi rê chuột vào ảnh */
.listing-table .listing-strips { max-width: 150px; gap: 4px; }
.listing-table .strip-item { position: relative; width: 32px; }
.listing-table .strip-item img { width: 32px; height: 32px; border-radius: 4px; }
.listing-table .strip-item .strip-meta { display: none; }
.listing-table .strip-item .strip-btns { display: none; position: absolute; left: -6px; right: -6px; bottom: 0; background: rgba(255, 255, 255, .96); border-radius: 4px; justify-content: center; gap: 1px; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); }
.listing-table .strip-item:hover .strip-btns, .listing-table .strip-item:focus-within .strip-btns { display: flex; }
.listing-table .strip-item .strip-btns .btn { padding: 0 2px; font-size: 9px; min-width: 0; }
.mockup-col { min-width: 120px; max-width: 220px; }
.mockup-thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.mockup-thumbs img { cursor: zoom-in; width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; display: block; }

/* Phần gập trong thẻ (thẻ shop): tiêu đề một dòng, bấm để mở */
.card-fold { border-top: 1px dashed var(--line, #e2e8f0); padding-top: 8px; }
.card-fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); list-style: none; display: flex; align-items: center; gap: 6px; }
.card-fold > summary::-webkit-details-marker { display: none; }
.card-fold > summary::before { content: '▸'; font-size: 11px; transition: transform .15s; }
.card-fold[open] > summary::before { transform: rotate(90deg); }
.card-fold[open] > summary { margin-bottom: 8px; color: inherit; }
.card-fold > *:not(summary) { margin-top: 6px; }
.card-fold .tg-block { border-top: 0; padding-top: 0; }
.tg-block input[type="checkbox"] { width: auto; min-height: 0; margin-right: 6px; }
/* Form nằm ngay trên trang (không phải trong hộp thoại): xếp ô thành lưới thay vì mỗi ô một dòng dài */
.content .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.content .form-grid .field input, .content .form-grid .field select, .content .form-grid .field textarea { width: 100%; }
.me .link { display: block; text-align: left; }
/* Thanh bên: menu dài thì cuộn bên trong, khối tài khoản luôn nằm ở đáy thanh bên (không tràn ra nền trắng) */
@media (min-width: 901px) {
  .sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
  .sidebar .me { flex: 0 0 auto; margin-top: 0; }
}
.me > div:last-child { margin-left: auto; text-align: right; }
.me .link { margin-left: 0; padding: 1px 0; white-space: nowrap; }

/* ---------- Điện thoại và màn hình hẹp (đặt cuối file để không bị các quy tắc phía trên ghi đè) ---------- */
.content > *, .grid-2 > *, .kpis > *, .stages > *, .cards > * { min-width: 0; } /* ô lưới được phép co lại, bảng rộng thì cuộn trong khung của nó */
@media (max-width: 900px) {
  .sidebar { padding: 10px 12px; gap: 8px; }
  .sidebar .nav { display: flex; flex: 1 1 100%; order: 3; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .sidebar .nav::-webkit-scrollbar { display: none; }
  .sidebar .nav-item { flex: 0 0 auto; white-space: nowrap; height: 34px; padding: 6px 10px; }
  .sidebar .me { margin-left: auto; padding: 6px 10px; }
  .nav-toggle { display: none; }
  .content { padding: 14px 12px 40px; gap: 14px; }
  .topbar { padding: 12px; gap: 10px; }
  .topbar h2 { font-size: 18px; }
  .kpis, .kpis.kpis-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel-head { flex-wrap: wrap; gap: 4px 12px; }
  .toolbar { gap: 8px; }
  .content .form-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  .kpis, .kpis.kpis-5, .stages { grid-template-columns: 1fr !important; }
  .content .form-grid { grid-template-columns: 1fr !important; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .kpi strong { font-size: 22px; }
  .top-actions .select, .top-actions .btn { flex: 1 1 auto; }
  .review-grid, .cards { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app > * { min-width: 0; } /* thanh menu cuộn ngang bên trong, không đẩy rộng cả trang */
  .sidebar .nav { min-width: 0; max-width: 100%; }
  .sidebar .brand { flex: 1 1 auto; }
  .sidebar .me { flex: 0 0 auto; order: 2; }
}

/* ---------- Bảng quản lý đơn hàng: cột cân đối, nội dung canh trên, cột Đơn đứng yên khi cuộn ngang ---------- */
#orderWrap table { width: max-content; min-width: 100%; }
#orderWrap th { padding: 10px 12px; white-space: nowrap; }
#orderWrap td { padding: 12px; vertical-align: top; line-height: 1.45; }
#orderWrap tbody tr:nth-child(even) td { background: #fbfcfe; }
#orderWrap tbody tr:hover td { background: #f3f7ff; }
#orderWrap .col-order { position: sticky; left: 0; z-index: 2; min-width: 118px; background: #fff; box-shadow: 1px 0 0 var(--line); }
#orderWrap th.col-order { background: #f8fafc; z-index: 3; }
#orderWrap .col-order strong { font-size: 14px; font-variant-numeric: tabular-nums; }
#orderWrap .col-order .sku-code { font-size: 10.5px; padding: 1px 5px; display: inline-block; margin-top: 4px; white-space: normal; word-break: break-all; }
#orderWrap .col-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
#orderWrap .col-shop { min-width: 96px; max-width: 120px; }
#orderWrap .col-status { min-width: 0; width: 168px; }
#orderWrap .col-status select { width: 100%; min-width: 150px; height: 32px; font-size: 13px; }
#orderWrap .col-cust { width: 180px; min-width: 160px; max-width: 200px; white-space: normal; overflow-wrap: anywhere; }
#orderWrap .note-col { min-width: 250px; max-width: 330px; width: 300px; }
#orderWrap .note-col .cust-field { max-width: none; margin-bottom: 4px; }
#orderWrap .mockup-col { min-width: 0; width: 112px; max-width: 160px; }
#orderWrap .col-tpl { width: 215px; min-width: 195px; max-width: 235px; white-space: normal; }
#orderWrap .col-pod { width: 170px; min-width: 160px; max-width: 220px; white-space: normal; }
#orderWrap .col-tpl .file-row, #orderWrap .col-pod .file-row { margin: 0 0 5px; align-items: flex-start; }
#orderWrap .col-tpl .file-link { max-width: none; white-space: normal; overflow: visible; line-height: 1.35; font-weight: 600; }
#orderWrap .col-tpl small { line-height: 1.35; display: block; font-size: 11.5px; }
#orderWrap .col-tpl small.warn-text { font-weight: 500; }
#orderWrap .col-pod .file-link { max-width: 150px; }
#orderWrap .pod-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 2px; }
#orderWrap .pod-actions .btn { white-space: nowrap; }
#orderWrap .col-ship { width: 176px; min-width: 176px; white-space: normal; }
#orderWrap .col-ship input { width: 100%; height: 32px; font: inherit; font-size: 12px; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; padding: 0 8px; font-variant-numeric: tabular-nums; }
#orderWrap .col-ship .btn, #orderWrap .col-ship small { display: inline-block; margin-top: 5px; }
#orderWrap .col-ship .trk { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#orderWrap .col-due { white-space: nowrap; }
#orderWrap .col-sup { max-width: 130px; white-space: normal; overflow-wrap: anywhere; }
#orderWrap .num-col { white-space: nowrap; }

/* ---------- Trang đơn hàng: khung lọc ba hàng thẳng cột (Tìm & lọc / Trạng thái / Cảnh báo) ---------- */
.om-panel { background: var(--card); border: 1px solid #e6ebf3; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(15, 23, 42, .03); margin-bottom: 10px; }
.om-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px 16px; }
.om-row + .om-row { border-top: 1px solid #eef2f7; }
.om-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 9px; }
.om-label small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11px; margin-top: 2px; }
.om-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.om-filters .order-search { flex: 1 1 260px; min-width: 220px; max-width: 420px; width: auto; height: 34px; font-size: 13.5px; font-weight: 500; }
.om-filters select, .om-filters input[type="date"] { height: 34px; font-size: 13px; padding: 0 8px; width: auto; min-width: 0; border: 1px solid #E2E8F0; border-radius: 6px; background: #fff; }
.om-filters .period-range { display: inline-flex; align-items: center; gap: 6px; }
.om-filters .period-range input[type="date"] { width: 138px; }
.om-seg { display: inline-flex; border: 1px solid #dbe3ee; border-radius: 8px; overflow: hidden; background: #fff; }
.om-seg .btn.small { border: 0; border-radius: 0; height: 32px; padding: 0 12px; font-weight: 600; margin: 0; }
.om-seg .btn.small + .btn.small { border-left: 1px solid #dbe3ee; }
.om-seg .btn.small.ghost { background: #fff; color: var(--ink-2); }
.om-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.om-actions .btn.small { height: 34px; padding: 0 12px; white-space: nowrap; }
.om-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.om-pills .btn.small { height: 32px; padding: 0 11px; font-weight: 600; font-size: 13px; background: #fff; border-color: #dbe3ee; color: var(--ink-2); }
.om-pills .btn.small b { margin-left: 5px; font-variant-numeric: tabular-nums; font-weight: 700; }
.om-pills .btn.small.primary { background: #0050c8; border-color: #0050c8; color: #fff; }
.om-pills .btn.small.zero:not(.primary) { color: #94a3b8; background: #f8fafc; }
.om-panel .order-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px; margin: 0; }
.om-panel .order-alerts .alert-chip { min-height: 34px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.om-panel .order-alerts .alert-chip b { font-size: 14px; font-weight: 800; }
.om-panel .order-alerts .alert-chip.zero:not(.on) { background: #f8fafc; color: #94a3b8; border-color: #e6ebf3; border-left-color: #cbd5e1; }
.om-note { display: block; margin: 0 2px 6px; }
@media (max-width: 900px) {
  .om-row { grid-template-columns: 1fr; gap: 6px; }
  .om-label { padding-top: 0; }
  .om-actions { margin-left: 0; }
}

#orderWrap .col-ship input + input { margin-top: 5px; }
#orderWrap .col-trk { width: 170px; min-width: 160px; max-width: 200px; white-space: normal; }
#orderWrap .col-trk small { display: block; margin-top: 4px; line-height: 1.35; font-weight: 500; }
#orderWrap .col-trk .btn { margin-top: 6px; }

.shop-staff { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 10px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px; }
.shop-staff-lines { display: grid; gap: 2px; line-height: 1.45; }

/* =====================================================================
   Giao diện v2 (19/11/2026): một lớp thống nhất cho toàn CRM.
   Chỉ đổi màu, chữ, khoảng cách, viền, bóng; không đổi bố cục hay nội dung.
   ===================================================================== */
:root {
  --bg: #f5f7fb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #667085;
  --line: #e6eaf2;
  --brand: #1552d9;
  --brand-2: #2f6bff;
  --ok: #0e9f6e;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .10);
  --ring: 0 0 0 3px rgba(21, 82, 217, .18);
}
body { font-size: 14px; line-height: 1.5; color: var(--ink); text-rendering: optimizeLegibility; }
small { color: var(--muted); }
a { color: var(--brand); }
::selection { background: rgba(21, 82, 217, .16); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* --- Thanh bên --- */
.sidebar { background: #0b1736; border-right: 1px solid rgba(255, 255, 255, .06); padding: 18px 12px; gap: 18px; }
.brand { font-size: 15.5px; letter-spacing: -.01em; }
.nav-title { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; color: rgba(255, 255, 255, .38); padding: 0 12px 6px; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-item { height: 36px; padding: 0 12px; gap: 11px; border-radius: 8px; color: #b6c2d9; font-size: 13.5px; font-weight: 500; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.nav-item .ico { width: 18px; opacity: .85; font-size: 13px; }
.nav-item.active .ico { opacity: 1; }
.badge { height: 18px; line-height: 18px; min-width: 20px; font-weight: 700; }
.me { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; padding: 10px 12px; }
.me .link { color: #9db8ff; }
.me .link:hover { color: #fff; }

/* --- Thanh trên và vùng nội dung --- */
.topbar { padding: 16px 32px; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.topbar p { font-size: 13px; color: var(--muted); margin-top: 1px; }
.content { padding: 24px 32px 56px; gap: 20px; }

/* --- Thẻ, bảng --- */
.panel, .kpi, .shop-card, .table-wrap, .om-panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.panel { padding: 18px 20px; }
.panel-head h3, .panel > h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.shop-card { padding: 18px; gap: 12px; }
.shop-card:hover, .cards > .card:hover { box-shadow: var(--shadow-lg); border-color: #d5dcea; }
.kpi { padding: 18px 20px; border-radius: var(--radius); }
.kpi::before { height: 3px; opacity: 1; background: var(--brand); }
.kpi.warn::before { background: var(--warn); opacity: 1; }
.kpi span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi strong { font-size: 26px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
th { padding: 10px 14px; font-size: 11px; font-weight: 650; letter-spacing: .05em; color: #5b6880; background: #f7f9fc; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; }
tbody tr:hover { background: #f8faff; }
.table-wrap { overflow: auto; }
.table-wrap thead th:first-child { border-top-left-radius: var(--radius); }
.table-wrap thead th:last-child { border-top-right-radius: var(--radius); }
.empty, .empty-compact, .empty-col { border-color: #d5dcea; background: #fbfcfe; border-radius: var(--radius); }

/* --- Nút --- */
.btn { height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; border: 1px solid #d5dcea; background: #fff; color: var(--ink-2); box-shadow: 0 1px 1px rgba(16, 24, 40, .04); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: #f7f9fc; border-color: #c3cde0; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); transform: none; }
.btn:active { background: #eef2f8; transform: none; }
.btn.primary { background: var(--brand); border: 1px solid var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(21, 82, 217, .35); }
.btn.primary:hover { background: #0f45bd; border-color: #0f45bd; box-shadow: 0 2px 6px rgba(21, 82, 217, .35); transform: none; }
.btn.ghost { background: #fff; }
.btn.danger { color: var(--bad); border-color: #f5c2c2; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.big { height: 46px; }
label.btn { cursor: pointer; }

/* --- Ô nhập --- */
input, select, textarea { border: 1px solid #d5dcea; border-radius: 8px; min-height: 36px; padding: 7px 11px; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b9c4d8; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: var(--brand); }
.field { gap: 5px; font-size: 13px; }
.field > span { font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; line-height: 1.4; }

/* --- Nhãn trạng thái --- */
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 6px; background: color-mix(in srgb, var(--c) 11%, white); border: 1px solid color-mix(in srgb, var(--c) 22%, white); }
.tag { border-radius: 6px; }
.warn-text { color: #b45309; }

/* --- Hộp thoại, thông báo --- */
.modal { background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); }
.modal-card { border-radius: 14px; padding: 0; box-shadow: 0 24px 64px rgba(16, 24, 40, .28); border: 1px solid var(--line); }
.modal-head { margin: 0; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; border-radius: 14px 14px 0 0; }
.modal-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
#modalForm { padding: 18px 22px 20px; gap: 14px; }
.modal-card > *:not(.modal-head):not(#modalForm) { margin-left: 22px; margin-right: 22px; }
.form-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.toast { border-radius: 10px; padding: 11px 16px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); }
.toast.ok { background: #0b7a55; }
.toast.bad { background: #b42318; }

/* --- Mục gập trong thẻ shop --- */
.card-fold { border-top: 1px solid #eef1f6; padding-top: 9px; }
.card-fold > summary { font-size: 13px; color: var(--ink-2); padding: 1px 0; }
.card-fold > summary:hover { color: var(--brand); }

/* --- Trang đơn hàng: ăn theo màu mới --- */
.om-pills .btn.small.primary, .order-alerts .alert-chip.on, .order-bar-left .btn.small.primary { background: var(--brand); border-color: var(--brand); }
.om-seg { border-color: #d5dcea; border-radius: 8px; box-shadow: 0 1px 1px rgba(16, 24, 40, .04); }
.om-seg .btn.small { box-shadow: none; height: 34px; }
.om-seg .btn.small.primary { background: var(--brand); color: #fff; }
.om-label { color: #5b6880; }
#orderWrap tbody tr:nth-child(even) td { background: #fafbfd; }
#orderWrap tbody tr:hover td { background: #f3f7ff; }
#orderWrap .col-order { background: #fff; }
#orderWrap tbody tr:nth-child(even) td.col-order { background: #fafbfd; }
#orderWrap tbody tr:hover td.col-order { background: #f3f7ff; }
.file-link { font-weight: 600; }
.sku-code { background: #eaf0ff; color: var(--brand); border-radius: 5px; }

/* --- Thanh cuộn --- */
* { scrollbar-width: thin; scrollbar-color: #c9d2e3 transparent; }
*::-webkit-scrollbar { height: 9px; width: 9px; }
*::-webkit-scrollbar-thumb { background: #c9d2e3; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #a9b6cf; background-clip: padding-box; border: 2px solid transparent; }
.sidebar { scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.sidebar *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); background-clip: padding-box; }

/* --- Đăng nhập --- */
.login { background: radial-gradient(900px 500px at 15% 0%, rgba(47, 107, 255, .28), transparent 60%), #0b1736; }
.login-card { border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); }
.nav-item { height: auto; min-height: 36px; padding: 7px 12px; line-height: 1.3; }

/* --- Bộ chọn kỳ thời gian dùng chung --- */
.period-seg { flex-wrap: wrap; }
.period-seg .btn.small { height: 32px; white-space: nowrap; }
.toolbar { align-items: center; flex-wrap: wrap; row-gap: 10px; }
.toolbar > div { align-items: center; }
.period-range input[type="date"] { height: 34px; width: 140px; border: 1px solid #d5dcea; border-radius: 8px; padding: 0 8px; font-size: 13px; }

/* --- Tổng quan doanh nghiệp theo ngày --- */
.day-quicks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.day-quick { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; display: grid; gap: 2px; }
.day-quick span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.day-quick strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.day-quick small b { font-weight: 700; }
.day-table { max-height: 420px; overflow: auto; border: 0; }
.day-table thead th { position: sticky; top: 0; z-index: 1; }
.day-table tfoot th { position: sticky; bottom: 0; background: #f7f9fc; border-top: 1px solid var(--line); border-bottom: 0; font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--ink); }
@media (max-width: 900px) { .day-quicks { grid-template-columns: 1fr; } }

/* --- Form kết nối nhà cung cấp: ba ô chọn nguồn --- */
.src-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.src-type { text-align: left; padding: 11px 13px; border: 1px solid #d5dcea; border-radius: 10px; background: #fff; cursor: pointer; display: grid; gap: 2px; font: inherit; color: var(--ink); }
.src-type b { font-size: 13.5px; font-weight: 650; }
.src-type small { font-size: 12px; font-weight: 400; color: var(--muted); }
.src-type:hover { border-color: #b9c4d8; background: #f8faff; }
.src-type.on { border-color: var(--brand); background: #eef4ff; box-shadow: var(--ring); }
.src-adv { border-top: 1px solid var(--line); padding-top: 10px; }
.src-adv > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.toast { max-width: min(560px, calc(100vw - 40px)); white-space: normal; line-height: 1.4; }
@media (max-width: 560px) { .src-types { grid-template-columns: 1fr; } }

.tag-miss { font: inherit; font-size: 11.5px; font-weight: 700; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 6px; padding: 2px 8px; cursor: pointer; white-space: nowrap; }
.tag-miss:hover { background: #fee4e2; }

/* --- Nhà cung cấp & công nợ dạng bảng --- */
.sup-table td, .sup-table th { vertical-align: middle; }
.sup-table tfoot th { background: #f7f9fc; border-top: 1px solid var(--line); border-bottom: 0; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.sup-toggle { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; width: 22px; height: 22px; border-radius: 6px; }
.sup-toggle:hover { background: #eef2f8; color: var(--brand); }
.sup-open > td { background: #f8faff; }
.sup-detail > td { background: #fbfcfe; padding: 12px 16px 16px 44px; }
.sup-months { width: auto; min-width: 520px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.sup-months th, .sup-months td { padding: 7px 12px; font-size: 13px; }
.sup-actions .btn { margin-left: 4px; }

#orderWrap .cogs-parts { display: block; margin-top: 3px; font-size: 11px; font-weight: 500; line-height: 1.35; white-space: nowrap; }
.om-seg .btn.small b { margin-left: 5px; font-variant-numeric: tabular-nums; opacity: .75; font-weight: 700; }
.om-pills .btn.small.pill-notrack:not(.primary):not(.zero) { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.om-pills .pill-sep { width: 1px; align-self: stretch; background: #dbe3ee; margin: 2px 4px; }

.cb-pool { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--card); }
.cb-table { width: auto; margin: 8px 0 10px; }
.cb-table td { padding: 5px 14px 5px 0; border: 0; font-size: 13px; }

/* --- Tinh chỉnh bố cục 20/11: thẻ shop rộng hơn, khối nhân sự / phí thuê không bị bóp chữ --- */
.cards { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.toolbar.toolbar-left { justify-content: flex-start; }
.shop-staff { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; padding: 10px 12px; }
.shop-staff-lines { gap: 3px; min-width: 0; }
.shop-staff .btn.small { white-space: nowrap; }
.shop-card .etsy-status { margin: 0; }
.shop-card h3 { overflow-wrap: anywhere; }
.th-hint { font-weight: 400; opacity: .55; cursor: help; }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
/* Bảng đơn: yêu cầu của khách viết "Tên mục: giá trị" trên một dòng, hàng thấp đi gần một nửa */
#orderWrap .note-col .cust-field { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 2px 6px; margin-bottom: 1px; }
#orderWrap .note-col .cust-field > small { flex: none; }
#orderWrap .note-col .cust-field > small::after { content: ':'; }
#orderWrap .note-col .cust-val { flex: 1 1 120px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
/* Hàng tiêu đề cột của bảng đơn bám dưới thanh trên cùng khi cuộn */
#orderFloatHead { position: fixed; z-index: 25; overflow: hidden; display: none; background: #f7f9fc; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 0 6px 14px rgba(15, 23, 42, .08); }
#orderFloatHead table { table-layout: fixed; border-collapse: collapse; margin: 0; }
#orderFloatHead th { padding: 10px 12px; white-space: nowrap; box-sizing: border-box; border-bottom: 0; border-radius: 0 !important; overflow: hidden; text-overflow: ellipsis; }
#orderFloatHead th.col-order { position: relative; z-index: 2; background: #f7f9fc; box-shadow: 1px 0 0 var(--line); }
/* Bảng đơn: cột Shop đủ rộng để Leader / Seller không gãy thành 3 dòng; "Chưa có SĐT" là thông tin phụ, không phải cảnh báo */
#orderWrap .col-shop { min-width: 136px; max-width: 180px; }
#orderWrap .col-shop small { white-space: nowrap; }
#orderWrap .no-phone { opacity: .7; font-style: italic; }
.sync-every { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sync-every select { min-height: 0; padding: 5px 8px; width: auto; }
