/* Workspace Phân phối — hồ sơ Cobalt-mono (docs/DESIGN_COBALT_MONO.md): token trong scope id gốc, dùng lại component của Toucan
   (.app-header styles.css · .dv2-* dashboard-v2.css · .cp-empty commercial-plan.css · sprite sales-icons.js · khuôn bảng crtpt của Commercial Report). */
#workspace-phan-phoi, .pp-dialog, dialog.dms-wrap {
  --so-ink: #18181B; --so-muted: #6B6B72; --so-soft: #A1A1AA; --so-bg: #F1F1F3; --so-card: #FFFFFF; --so-line: #ECECEE;
  --so-cobalt: #2563EB; --so-cobalt-h: #1D4ED8; --so-tint: #E5EDFF; --so-tint-2: #F4F6FF;
  --so-amber: #F59E0B; --so-teal: #3FC9BA; --so-crimson: #E2445C;
  --so-sh: 0 2px 18px rgba(20, 20, 25, .05); --so-sh-pop: 0 18px 50px rgba(22, 32, 51, .16);
  --ink: var(--so-ink); --cobalt: var(--so-cobalt); --amber: var(--so-amber); --teal: var(--so-teal); --red: #DC2626; --lime: #E8EC13;
  --card: var(--so-card); --line: var(--so-line); --muted: var(--so-muted); --soft: var(--so-soft);
  --accent: var(--so-cobalt); --accent-2: var(--so-cobalt-h); --accent-soft: var(--so-tint); --border: var(--so-line);
  --text: var(--so-ink); --text-muted: var(--so-muted); --text-soft: var(--so-soft); --bg-card: #fff; --bg-hover: var(--so-tint-2); --shadow-sm: var(--so-sh);
  font-family: 'Public Sans', 'Be Vietnam Pro', 'Figtree', 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--so-ink);
}
#workspace-phan-phoi { overflow: auto; background: var(--so-bg); }
#workspace-phan-phoi [hidden], .pp-dialog [hidden], dialog.dms-wrap [hidden] { display: none !important; }
#workspace-phan-phoi .ic, .pp-dialog .ic { display: inline-block; flex-shrink: 0; width: 18px; height: 18px; vertical-align: -3px; }
#workspace-phan-phoi .ic-sm, .pp-dialog .ic-sm { width: 15px; height: 15px; }
#workspace-phan-phoi .ic-lg { width: 22px; height: 22px; }
#workspace-phan-phoi :is(.dms-table, .crtpt-tbl, .abi-stock-table, .dms-counts, .dv2-kband, .dv2-tiles, .pp-cols), .pp-dialog .dms-table, dialog.dms-wrap .dms-table { font-variant-numeric: tabular-nums; }

/* Header app — khuôn .sticky-top > .app-header của Sales OS */
#workspace-phan-phoi .pp-top { z-index: 30; }
/* Chừa chỗ nút «Báo lỗi» (cố định góc phải trên) để không che nút Đồng bộ và chuông */
#workspace-phan-phoi .pp-top .controls { align-items: center; gap: 8px; padding-right: 108px; }
#workspace-phan-phoi .app-header { background: #fff; border-bottom: 1px solid var(--so-line); }
#workspace-phan-phoi .brand { gap: 12px; }
#workspace-phan-phoi .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--so-tint); }
#workspace-phan-phoi .logo img { max-width: 28px; max-height: 24px; }
#workspace-phan-phoi .app-header h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; color: var(--so-ink); }
#workspace-phan-phoi .app-header .sub { margin-top: 2px; font-size: 12px; color: var(--so-muted); font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-bu { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px; border-radius: 99px; background: #F4F4F5; font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--so-ink); }
#workspace-phan-phoi .pp-bu i { width: 8px; height: 8px; border-radius: 50%; background: var(--bu, var(--so-crimson)); }
#workspace-phan-phoi .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#workspace-phan-phoi .controls .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid #C7D6FF; border-radius: 9px; background: #fff; color: var(--so-cobalt-h); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
#workspace-phan-phoi .controls .btn-secondary:hover { background: var(--so-cobalt); border-color: var(--so-cobalt); color: #fff; }
@media (min-width: 901px) { #workspace-phan-phoi .app-header { padding: 10px 24px; gap: 12px; } }

/* Tab của workspace (rail trái thường che hàng này) + tab con dạng nút chia đoạn .dv2-oltabs */
#workspace-phan-phoi .pp-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 24px 0; }
#workspace-phan-phoi .pp-tabs .tab-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--so-line); border-radius: 99px; background: #fff; color: var(--so-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
#workspace-phan-phoi .pp-tabs .tab-btn.active { background: var(--so-cobalt); border-color: var(--so-cobalt); color: #fff; }
#workspace-phan-phoi .pp-tabs .tab-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }
#workspace-phan-phoi .pp-sub { display: flex; width: max-content; max-width: calc(100% - 48px); margin: 18px 24px 0; overflow-x: auto; background: #E7E7EA; }
#workspace-phan-phoi .pp-sub button[aria-pressed="true"] { background: #fff; color: var(--so-ink); box-shadow: 0 1px 3px rgba(20, 20, 25, .12); }
#workspace-phan-phoi .pp-badge { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; vertical-align: 1px; }
#workspace-phan-phoi .pp-tabs .pp-badge { margin-left: 0; }
#workspace-phan-phoi .pp-badge[hidden] { display: none; }
.pp-empty { padding: 24px; }

/* Khung màn + tiêu đề */
#workspace-phan-phoi .dms-wrap, #workspace-phan-phoi .abi-trade-pay { max-width: none; margin: 0; padding: 20px 24px 32px; font-family: inherit; font-size: 14px; color: var(--so-ink); }
#workspace-phan-phoi .dms-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
#workspace-phan-phoi .dms-wrap > h1, #workspace-phan-phoi .dms-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; color: var(--so-ink); }
#workspace-phan-phoi .pp-desc { margin: 4px 0 0; max-width: 820px; font-size: 13px; line-height: 1.5; color: var(--so-muted); }
#workspace-phan-phoi .pp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#workspace-phan-phoi .dms-head .dv2-stat { margin-left: 0; }
.pp-err { color: #C81E3A; margin: 12px 0 0; white-space: pre-wrap; }
.pp-err:empty { display: none; }
#workspace-phan-phoi .pp-loading { margin: 24px 0; color: var(--so-muted); }

/* Ô nhập, nút */
#workspace-phan-phoi :where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=range]), select, textarea),
.pp-dialog :where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea),
dialog.dms-wrap :where(input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea) {
  box-sizing: border-box; max-width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid #E4E4E7; border-radius: 10px; background-color: #fff;
  color: var(--so-ink); font: inherit; font-size: 13px; font-weight: 600; transition: border-color .15s ease, box-shadow .15s ease;
}
#workspace-phan-phoi :where(input, select, textarea):focus, .pp-dialog :where(input, select, textarea):focus, dialog.dms-wrap :where(input, select, textarea):focus {
  outline: none; border-color: var(--so-cobalt); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
#workspace-phan-phoi :where(select), .pp-dialog :where(select), dialog.dms-wrap :where(select) {
  -webkit-appearance: none; appearance: none; padding-right: 30px; cursor: pointer; background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
#workspace-phan-phoi :where(input, textarea)::placeholder, .pp-dialog :where(input, textarea)::placeholder { color: var(--so-soft); font-weight: 500; }
#workspace-phan-phoi .dms-wrap button, #workspace-phan-phoi .pp-warn button, .pp-dialog button, dialog.dms-wrap button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 13px; border: 1px solid #E4E4E7; border-radius: 9px;
  background: #fff; color: var(--so-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
#workspace-phan-phoi .dms-wrap button:hover:not(:disabled), #workspace-phan-phoi .pp-warn button:hover:not(:disabled), .pp-dialog button:hover:not(:disabled), dialog.dms-wrap button:hover:not(:disabled) { border-color: #C7D6FF; background: var(--so-tint-2); color: var(--so-cobalt-h); }
#workspace-phan-phoi .dms-wrap button:disabled, .pp-dialog button:disabled, dialog.dms-wrap button:disabled { opacity: .5; cursor: default; }
#workspace-phan-phoi .dms-wrap .dms-primary, .pp-dialog .dms-primary, .pp-dialog button[type="submit"], dialog.dms-wrap .dms-primary { background: var(--so-cobalt); border-color: var(--so-cobalt); color: #fff; }
#workspace-phan-phoi .dms-wrap .dms-primary:hover:not(:disabled), .pp-dialog :is(.dms-primary, button[type="submit"]):hover:not(:disabled), dialog.dms-wrap .dms-primary:hover:not(:disabled) { background: var(--so-cobalt-h); border-color: var(--so-cobalt-h); color: #fff; }
#workspace-phan-phoi :is(button, input, select, textarea):focus-visible, .pp-dialog :is(button, input, select, textarea):focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }
@media (prefers-reduced-motion: no-preference) { #workspace-phan-phoi .dms-wrap button:active:not(:disabled), .pp-dialog button:active:not(:disabled) { transform: scale(.96); } }
#workspace-phan-phoi .dms-wrap .tf-btn, .pp-dialog .tf-btn, dialog.dms-wrap .tf-btn { width: 20px; min-height: 20px; height: 20px; padding: 0; margin-left: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--so-soft); vertical-align: middle; }
#workspace-phan-phoi .dms-wrap .tf-btn:hover, .pp-dialog .tf-btn:hover, dialog.dms-wrap .tf-btn:hover { background: #EDEDF0; color: var(--so-ink); }
.pp-link { border: 0 !important; padding: 0 !important; min-height: 0 !important; background: none !important; color: var(--so-cobalt-h, #1D4ED8) !important; font-weight: 700; text-align: left; cursor: pointer; }
.pp-link:hover { text-decoration: underline; }

/* Thanh lọc dạng thẻ + pill */
#workspace-phan-phoi :is(.dms-import-form, .dms-map-form, .dms-sync-config, .dms-sync-summary) { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .dms-sync-summary { display: grid; align-items: start; gap: 6px; }
#workspace-phan-phoi .dms-sync-summary h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
#workspace-phan-phoi .dms-wrap label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .dms-sync-config .dms-sync-check { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--so-ink); }
#workspace-phan-phoi .dms-sync-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
#workspace-phan-phoi .pp-fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 16px; padding: 10px 14px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .pp-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#workspace-phan-phoi .pp-pills > span { margin-right: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--so-soft); }
#workspace-phan-phoi .dms-wrap .pp-pills button { min-height: 30px; padding: 0 13px; border-color: var(--so-line); border-radius: 99px; color: var(--so-muted); font-size: 12.5px; font-weight: 600; }
#workspace-phan-phoi .dms-wrap .pp-pills button[aria-pressed="true"] { background: var(--so-cobalt); border-color: var(--so-cobalt); color: #fff; }
#workspace-phan-phoi .pp-month { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 99px; background: #F4F4F5; }
#workspace-phan-phoi .pp-month b { min-width: 116px; font-size: 13px; font-weight: 800; text-align: center; }
#workspace-phan-phoi .dms-wrap .pp-month button { width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: 99px; background: transparent; color: var(--so-muted); font-size: 18px; line-height: 1; }
#workspace-phan-phoi .dms-wrap .pp-month button:hover { background: #fff; color: var(--so-cobalt-h); }
#workspace-phan-phoi .dms-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 3px; border: 0; border-radius: 10px; background: #E7E7EA; }
#workspace-phan-phoi .dms-wrap .dms-tabs button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--so-muted); font-size: 12.5px; font-weight: 700; }
#workspace-phan-phoi .dms-wrap .dms-tabs button:is([aria-pressed="true"], .active) { background: #fff; color: var(--so-ink); box-shadow: 0 1px 3px rgba(20, 20, 25, .12); }
#workspace-phan-phoi .dms-pending { display: inline-flex; align-items: center; align-self: center; padding: 5px 12px; border-radius: 99px; background: #FEF3C7; color: #B45309; font-size: 12.5px; font-weight: 700; }

/* Thẻ KPI — dải màu 3px mép trái như .dv2-kc, tối đa 5 thẻ một hàng */
#workspace-phan-phoi .dms-counts, .pp-dialog .dms-counts, dialog.dms-wrap .dms-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(160px, calc((100% - 48px) / 5)), 1fr)); gap: 12px; margin-top: 16px; }
#workspace-phan-phoi .dms-counts > div, .pp-dialog .dms-counts > div, dialog.dms-wrap .dms-counts > div {
  --acc: var(--so-cobalt); position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px 14px 18px;
  background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh);
}
#workspace-phan-phoi .dms-counts > div::before, .pp-dialog .dms-counts > div::before, dialog.dms-wrap .dms-counts > div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
#workspace-phan-phoi .dms-counts span, .pp-dialog .dms-counts span, dialog.dms-wrap .dms-counts span { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--so-muted); }
#workspace-phan-phoi .dms-counts b, .pp-dialog .dms-counts b, dialog.dms-wrap .dms-counts b { font-size: clamp(18px, 1.5vw, 24px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--so-ink); overflow-wrap: anywhere; }
#workspace-phan-phoi .dms-counts > .pp-kpi-bad, .pp-dialog .dms-counts > .pp-kpi-bad { --acc: #DC2626; }
#workspace-phan-phoi .dms-counts > .pp-kpi-bad b, .pp-dialog .dms-counts > .pp-kpi-bad b { color: #C81E3A; }
#workspace-phan-phoi .dms-counts > .pp-kpi-warn, .pp-dialog .dms-counts > .pp-kpi-warn { --acc: #F59E0B; }
#workspace-phan-phoi .dms-counts > .pp-kpi-warn b, .pp-dialog .dms-counts > .pp-kpi-warn b { color: #B45309; }
#workspace-phan-phoi .dms-counts small, .pp-dialog .dms-counts small { color: var(--so-muted); font-size: 11.5px; line-height: 1.4; }

/* Bảng kiểu board */
#workspace-phan-phoi .dms-table, .pp-dialog .dms-table, dialog.dms-wrap .dms-table { max-height: 64vh; margin: 16px 0; overflow: auto; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .dms-table table, .pp-dialog .dms-table table, dialog.dms-wrap .dms-table table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; text-align: left; }
#workspace-phan-phoi .dms-table :is(th, td), .pp-dialog .dms-table :is(th, td), dialog.dms-wrap .dms-table :is(th, td) { padding: 10px 12px; border-bottom: 1px solid #F1F1F3; vertical-align: middle; }
#workspace-phan-phoi .dms-table thead th, .pp-dialog .dms-table thead th, dialog.dms-wrap .dms-table thead th {
  position: sticky; top: 0; z-index: 2; background: #F7F7F9; border-bottom: 1px solid var(--so-line); color: var(--so-ink);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
#workspace-phan-phoi .dms-table tbody th, .pp-dialog .dms-table tbody th { position: static; background: transparent; font-size: 13px; text-transform: none; letter-spacing: 0; }
#workspace-phan-phoi .dms-table tbody tr:hover > :is(td, th), .pp-dialog .dms-table tbody tr:hover > td, dialog.dms-wrap .dms-table tbody tr:hover > td { background: var(--so-tint-2); }
#workspace-phan-phoi .dms-table tbody tr:last-child > :is(td, th), .pp-dialog .dms-table tbody tr:last-child > td { border-bottom: 0; }
#workspace-phan-phoi .dms-table small, .pp-dialog .dms-table small, dialog.dms-wrap .dms-table small { display: block; margin-top: 3px; color: var(--so-muted); font-size: 11.5px; }
#workspace-phan-phoi .dms-table :is(td, th).n, .pp-dialog .dms-table :is(td, th).n, .pp-ar .n, .pp-ar-dlg .n, .pp-hd .n, .pp-hd-dlg .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .dms-table tfoot :is(th, td), .pp-dialog .dms-table tfoot :is(th, td) { position: sticky; bottom: 0; background: #FAFAFB; border-top: 1px solid var(--so-line); border-bottom: 0; font-weight: 800; }
#workspace-phan-phoi .dms-table .pp-group th { background: var(--so-tint); border-top: 2px solid var(--so-cobalt); color: var(--so-cobalt-h); font-size: 12px; font-weight: 800; }
#workspace-phan-phoi .dms-table tbody tr:hover > td.pp-empty-cell, #workspace-phan-phoi td.pp-empty-cell { padding: 0; background: #fff; }
#workspace-phan-phoi .pp-order .dms-table :is(td, th) { white-space: nowrap; }

/* Empty state — khuôn .cp-empty */
#workspace-phan-phoi .cp-empty, .pp-dialog .cp-empty { gap: 6px; padding: 32px 20px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); color: var(--so-muted); }
#workspace-phan-phoi :is(td, .dv2-card) .cp-empty, .pp-dialog td .cp-empty { padding: 28px 16px; background: transparent; border: 0; box-shadow: none; }
#workspace-phan-phoi .cp-empty-icon, .pp-dialog .cp-empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--so-tint); color: var(--so-cobalt); font-size: 0; opacity: 1; }
#workspace-phan-phoi .cp-empty-icon .ic, .pp-dialog .cp-empty-icon .ic { width: 22px; height: 22px; }
#workspace-phan-phoi .cp-empty h3, .pp-dialog .cp-empty h3 { margin: 6px 0 0; font-size: 15px; font-weight: 800; color: var(--so-ink); }
#workspace-phan-phoi .cp-empty p, .pp-dialog .cp-empty p { margin: 0; max-width: 460px; font-size: 13px; line-height: 1.55; color: var(--so-muted); white-space: normal; }

/* Chip trạng thái mềm có chấm, tag, cảnh báo, tiêu đề mục */
.pp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 99px; background: #F4F4F5; color: #6B6B72; font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; vertical-align: 1px; }
.pp-chip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pp-chip.ok { background: #E4F8F5; color: #0F766E; }
.pp-chip.warn { background: #FEF3C7; color: #B45309; }
.pp-chip.bad { background: #FDE8EC; color: #C81E3A; }
.pp-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: #E5EDFF; color: #1D4ED8; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.pp-muted { color: #6B6B72; }
.pp-warn { margin: 16px 0 0; padding: 10px 14px 10px 32px; background: #fff; border: 1px solid #ECECEE; border-left: 3px solid #F59E0B; border-radius: 12px; box-shadow: 0 2px 18px rgba(20, 20, 25, .05); color: #78350F; font-size: 13px; line-height: 1.6; }
.pp-warn.bad { border-left-color: #DC2626; color: #7F1D1D; }
#workspace-phan-phoi .pp-warn button { min-height: 28px; margin-left: 6px; padding: 0 10px; font-size: 12.5px; }
#workspace-phan-phoi .pp-h2, .pp-dialog .pp-h2 { display: flex; align-items: center; gap: 8px; margin: 28px 0 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--so-ink); }
#workspace-phan-phoi .pp-h2::before, .pp-dialog .pp-h2::before { content: ""; flex: none; width: 3px; height: 16px; border-radius: 2px; background: var(--so-cobalt); }
#workspace-phan-phoi .pp-h3 { margin: 22px 0 0; font-size: 13.5px; font-weight: 800; color: var(--so-ink); }
.pp-money .pp-h2:first-child { margin-top: 8px; }
#workspace-phan-phoi :is(.dms-period, .pp-note-line) { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--so-muted); }
.pp-wide { flex: 1 0 100%; }
.pp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.pp-row-act { white-space: nowrap; }
.pp-row-act button + button { margin-left: 6px; }
#workspace-phan-phoi .pp-row-act button { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
.pp-hang .pp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pp-hang .pp-check input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: #2563EB; }
.pp-hang :is(td, th).n { text-align: right; font-variant-numeric: tabular-nums; }
/* App Manager › Cài đặt hệ thống: app-manager-v2.css reset `#workspace-app-manager * { margin:0; padding:0 }` ⇒ khai lại khoảng cách. */
#workspace-app-manager .pp-hang { padding: 8px 4px 24px; }
#workspace-app-manager .pp-hang .dms-head { margin-bottom: 16px; }
#workspace-app-manager .pp-hang .dms-head h1 { margin: 0; font-size: 22px; }
#workspace-app-manager .pp-hang .dms-table :is(th, td) { padding: 11px 14px; }
#workspace-app-manager .pp-hang button { padding: 0 14px; }
#workspace-app-manager .pp-hang .pp-row-act button { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
#workspace-app-manager .pp-hang .pp-row-act button + button { margin-left: 6px; }
#workspace-app-manager .pp-hang .pp-chip { padding: 2px 9px 2px 8px; }
#workspace-app-manager .pp-hang .pp-dot { margin-right: 8px; }
#workspace-app-manager .pp-hang .cp-empty { padding: 28px 16px; }
#workspace-app-manager .pp-hang .pp-err { margin-top: 12px; }
#workspace-app-manager .pp-hang .tf-btn { width: 20px; min-height: 20px; height: 20px; padding: 0; margin-left: 4px; border: 0; border-radius: 6px; background: transparent; color: #A1A1AA; vertical-align: middle; }
#workspace-app-manager .pp-hang .tf-btn:hover { background: #EDEDF0; color: #18181B; }
.pp-plan { margin-top: 16px; }
.pp-sel-total { align-self: center; font-weight: 700; color: #1D4ED8; }
#workspace-phan-phoi .pp-trip { margin-top: 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
.pp-trip > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pp-trip > header h3 { margin: 0; font-size: 15px; font-weight: 800; }
.pp-trip > header .pp-actions { margin-left: auto; }
#workspace-phan-phoi .pp-trip .dms-table { margin: 12px 0 0; box-shadow: none; }
.pp-dialog .pp-rebate-cfg th input[data-pct] { width: 64px; margin: 0 2px; }
.pp-dialog .pp-rebate-cfg td input[data-rate] { width: 96px; }
#workspace-phan-phoi :is(.pp-target-grid, .pp-abi-grid) input { width: 96px; min-height: 32px; padding: 4px 8px; text-align: right; }
#workspace-phan-phoi :is(.pp-target-grid, .pp-abi-grid) tbody th { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 700; text-align: left; white-space: nowrap; }
#workspace-phan-phoi :is(.pp-target-grid, .pp-abi-grid) tbody th small { display: block; color: var(--so-muted); font-weight: 500; }
#workspace-phan-phoi :is(.pp-target-grid, .pp-abi-grid) td { text-align: right; }
#workspace-phan-phoi .pp-c2-tgt { border: 0; padding: 0; background: none; color: var(--so-accent, #2563EB); font: inherit; font-weight: 600; text-align: right; white-space: nowrap; cursor: pointer; }
#workspace-phan-phoi .pp-c2-tgt:hover { text-decoration: underline; }
#workspace-phan-phoi .pp-abi-grid td small { display: block; color: var(--so-muted); font-weight: 500; }
#workspace-phan-phoi .pp-abi-grid thead th { position: static; text-align: right; }
#workspace-phan-phoi .pp-abi-grid thead th:first-child, #workspace-phan-phoi .pp-abi-grid thead th[colspan] { text-align: left; }
#workspace-phan-phoi .pp-abi-grid thead th[colspan] { border-left: 1px solid var(--so-line); }
#workspace-phan-phoi .pp-abi-grid tbody td:nth-of-type(4) { border-left: 1px solid var(--so-line); }
#workspace-phan-phoi .pp-abi-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
#workspace-phan-phoi .pp-abi-bar .pp-h2 { flex: 1 1 260px; }
#workspace-phan-phoi .pp-abi-bar label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-target .pp-sum > * { background: #FAFAFB; border-top: 1px solid var(--so-line); font-weight: 800; }
#workspace-phan-phoi .pp-bad { color: #C81E3A; }
#workspace-phan-phoi .pp-ok { color: #0F766E; }
#workspace-phan-phoi .pp-c2-stock input { width: 96px; min-height: 32px; padding: 4px 8px; text-align: right; }
#workspace-phan-phoi .pp-c2-stock td { text-align: right; }
#workspace-phan-phoi .pp-c2-doi tr.pp-row-bad > td { background: #FEF2F2; }
#workspace-phan-phoi .pp-foc-grid tr.pp-row-warn > * { background: #FFF7ED; }
#workspace-phan-phoi .pp-c2-kpi thead th { position: static; }
#workspace-phan-phoi .pp-c2-kpi thead th[colspan] { border-left: 1px solid var(--so-line); }
#workspace-phan-phoi .pp-c2-kpi tbody td:nth-of-type(5), #workspace-phan-phoi .pp-c2-kpi tbody td:nth-of-type(9) { border-left: 1px solid var(--so-line); }
#workspace-phan-phoi .pp-c2-kpi tbody td:last-child { white-space: nowrap; }
#workspace-phan-phoi .pp-c2-plan tbody th[rowspan] { vertical-align: top; background: #fff; border-right: 1px solid var(--so-line); }

/* Hộp thoại — header trắng, viền trên cobalt 3px */
.pp-dialog { box-sizing: border-box; width: min(880px, 94vw); max-height: 86vh; max-height: 86dvh; margin: auto; overscroll-behavior: contain; padding: 0 20px 20px; overflow: auto; border: 0; border-top: 3px solid var(--so-cobalt); border-radius: 16px; background: #fff; box-shadow: var(--so-sh-pop); font-size: 14px; }
:is(.pp-dialog, .abi-customer-dialog)::backdrop { background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.abi-customer-dialog { margin: auto; overscroll-behavior: contain; }
html:has(> body > dialog:is(.pp-dialog, .abi-customer-dialog)[open]) { overflow: hidden; }
:is(.pp-dialog, .abi-customer-dialog) > header > [data-close] { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #6B6B72; font-size: 0; line-height: 1; cursor: pointer; }
:is(.pp-dialog, .abi-customer-dialog) > header > [data-close]::before { content: "✕"; content: "✕" / ""; font-size: 17px; font-weight: 600; }
:is(.pp-dialog, .abi-customer-dialog) > header > [data-close]:hover { background: #EDEDF0; color: #18181B; }
.pp-dialog > header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -20px 4px; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--so-line); }
.pp-dialog > header h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.pp-dialog h3 { margin: 20px 0 10px; font-size: 14px; font-weight: 800; }
.pp-dialog [role="status"] { margin-left: 8px; color: #0F766E; font-size: 12px; font-weight: 700; }
.pp-dialog .dms-table input[type="number"] { width: 110px; }
.pp-dialog .pp-pick { display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -10px -8px; cursor: pointer; }
.pp-dialog .pp-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--so-cobalt); cursor: pointer; }
.pp-dialog .pp-misa-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pp-dialog .pp-misa-where { margin-top: 16px; padding: 10px 14px; border-left: 3px solid var(--so-cobalt); border-radius: 8px; background: var(--so-tint-2); color: var(--so-ink); }
.pp-dialog .pp-misa-where h3 { margin: 0 0 6px; }
.pp-dialog .pp-misa-where ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.pp-dialog .pp-misa-blocked { margin: 0; padding-left: 20px; color: #C81E3A; font-size: 13px; line-height: 1.5; }
.pp-dialog textarea { width: 100%; font: 13px ui-monospace, Consolas, monospace; }
.pp-dialog fieldset { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; padding: 10px 12px; border: 1px solid var(--so-line); border-radius: 12px; }
.pp-dialog legend { padding: 0 4px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
.pp-c2-dlg { width: min(980px, 94vw); }
.pp-cfg-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pp-cfg-form h3 { flex: 1 0 100%; margin: 16px 0 0; }
.pp-cfg-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
.pp-check { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 600 !important; color: var(--so-ink) !important; }
.pp-check small { color: #6B6B72; }

/* Tổng quan — hàng biểu đồ, cột tuần, trend 6 tháng, bảng Target/Actual (khuôn crtpt của Commercial Report) */
#workspace-phan-phoi .pp-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#workspace-phan-phoi .pp-tcard { margin-bottom: 16px; }
#workspace-phan-phoi .pp-tcard .dms-table { margin: 12px 0 0; box-shadow: none; }
#workspace-phan-phoi [data-pp-placed] .dv2-ct { flex-wrap: wrap; }
#workspace-phan-phoi .pp-placed-staff { margin-left: auto; }
#workspace-phan-phoi .pp-placed-staff select { min-width: 190px; }
#workspace-phan-phoi .pp-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; height: 214px; margin-top: 14px; }
#workspace-phan-phoi .pp-col { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: center; min-width: 0; text-align: center; }
#workspace-phan-phoi .pp-col-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: 100%; min-height: 0; }
#workspace-phan-phoi .pp-col-bar em { margin-bottom: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--so-muted); white-space: nowrap; }
#workspace-phan-phoi .pp-col-bar i { width: min(46px, 64%); border-radius: 6px 6px 2px 2px; background: var(--so-cobalt); transition: height .4s cubic-bezier(.22, 1, .36, 1); }
#workspace-phan-phoi .pp-col > b { margin-top: 8px; padding-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-col.is-cur > b { font-weight: 800; color: var(--so-ink); box-shadow: inset 0 -2px 0 var(--so-cobalt); }
#workspace-phan-phoi .pp-col > small { font-size: 11px; color: var(--so-soft); white-space: nowrap; }
#workspace-phan-phoi .pp-trend { display: block; width: 100%; height: auto; margin-top: 10px; overflow: visible; }
#workspace-phan-phoi .pp-trend .ax { stroke: #E6EAF4; stroke-width: 1; }
#workspace-phan-phoi .pp-trend .ln { fill: none; stroke: var(--so-cobalt); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
#workspace-phan-phoi .pp-trend .tg { fill: none; stroke: #A1A1AA; stroke-width: 1.5; stroke-dasharray: 5 5; }
#workspace-phan-phoi .pp-trend circle { fill: #fff; stroke: var(--so-cobalt); stroke-width: 2.5; }
#workspace-phan-phoi .pp-trend .cur circle { fill: var(--so-cobalt); }
#workspace-phan-phoi .pp-trend text { font-size: 12px; font-weight: 700; text-anchor: middle; fill: var(--so-muted); }
#workspace-phan-phoi .pp-trend .cur text { fill: var(--so-ink); font-weight: 800; }
#workspace-phan-phoi .crtpt-scroll { margin-top: 12px; overflow-x: auto; border: 1px solid var(--so-line); border-radius: 12px; }
#workspace-phan-phoi .crtpt-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
#workspace-phan-phoi .crtpt-tbl th { height: 42px; padding: 0 12px; white-space: nowrap; }
#workspace-phan-phoi .crtpt-tbl td { height: 44px; padding: 8px 12px; white-space: nowrap; }
#workspace-phan-phoi .crtpt-tbl thead th { position: static; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
#workspace-phan-phoi .crtpt-band th { height: 30px; color: #fff; text-align: center; }
#workspace-phan-phoi .crtpt-band-blank { background-color: #fff; }
#workspace-phan-phoi .crtpt-band-tgt { background-color: #2563EB; }
#workspace-phan-phoi .crtpt-band-act { background-color: #F59E0B; }
#workspace-phan-phoi .crtpt-sub th { height: 36px; background-color: #fff; border-bottom: 1px solid #D7DCEB; color: #6B6B72; text-align: right; }
#workspace-phan-phoi .crtpt-sub th.crtpt-pic { text-align: left; }
#workspace-phan-phoi .crtpt-tbl :is(th, td):first-child { width: 34%; min-width: 240px; white-space: normal; line-height: 1.35; }
#workspace-phan-phoi .crtpt-tbl td { border-bottom: 1px solid #F1F2F6; }
#workspace-phan-phoi .crtpt-tbl td small { display: block; color: var(--so-muted); font-size: 11.5px; }
#workspace-phan-phoi .crtpt-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .crtpt-tbl :is(td, thead th) { background-image: linear-gradient(var(--col, transparent), var(--col, transparent)); }
#workspace-phan-phoi .crtpt-tgtcol.crtpt-r0 { --col: rgba(37, 99, 235, .05); }
#workspace-phan-phoi .crtpt-actcol.crtpt-r0 { --col: rgba(245, 158, 11, .06); }
#workspace-phan-phoi .crtpt-tbl :is(th, td).crtpt-bsep { border-left: 2px solid #C8D0E4; }
#workspace-phan-phoi .crtpt-tbl td.crtpt-tgtcol { color: #63708A; }
#workspace-phan-phoi .crtpt-row:hover td { background-color: #EEF1F8; }
#workspace-phan-phoi .crtpt-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
#workspace-phan-phoi .crtpt-av { display: inline-flex; flex: 0 0 24px; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 99px; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .2px; }
#workspace-phan-phoi .crtpt-total td { height: 46px; background-color: #EEF1F7; border-top: 2px solid #C8D0E4; border-bottom: 0; font-weight: 800; }
#workspace-phan-phoi .crtpt-pill { position: relative; display: inline-block; min-width: 66px; padding: 3px 10px; overflow: hidden; border-radius: 99px; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .crtpt-pill::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 0%); }
#workspace-phan-phoi .crtpt-pill span { position: relative; }
#workspace-phan-phoi .crtpt-pill.done { background-color: #C9F0DE; color: #046B44; }
#workspace-phan-phoi .crtpt-pill.done::before { background-color: #8FE3BF; }
#workspace-phan-phoi .crtpt-pill.work { background-color: #FCE6C4; color: #8A5206; }
#workspace-phan-phoi .crtpt-pill.work::before { background-color: #FBCF8D; }
#workspace-phan-phoi .crtpt-pill.stuck { background-color: #FBDAE1; color: #A81F35; }
#workspace-phan-phoi .crtpt-pill.stuck::before { background-color: #F5B3C0; }
#workspace-phan-phoi .crtpt-pill.na { background-color: #F1F2F6; color: #AEB5C6; }
#workspace-phan-phoi .crtpt-tbl td.pp-empty-cell { height: auto; padding: 0; white-space: normal; }

/* Kho, LOT & tồn C2 (abi-inventory) cùng khuôn */
#workspace-phan-phoi .abi-stock { padding: 20px 24px 32px; background: transparent; color: var(--so-ink); font: 14px/1.5 'Public Sans', 'Be Vietnam Pro', system-ui, sans-serif; }
#workspace-phan-phoi .abi-stock h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
#workspace-phan-phoi .abi-stock label { font-size: 12px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .abi-stock button { min-height: 34px; padding: 0 13px; border: 1px solid #E4E4E7; border-radius: 9px; background: #fff; color: var(--so-ink); font-size: 13px; font-weight: 700; }
#workspace-phan-phoi .abi-stock button:hover:not(:disabled) { border-color: #C7D6FF; background: var(--so-tint-2); color: var(--so-cobalt-h); }
#workspace-phan-phoi .abi-stock nav { display: inline-flex; gap: 4px; width: max-content; max-width: 100%; margin: 16px 0; padding: 3px; border-radius: 10px; background: #E7E7EA; }
#workspace-phan-phoi .abi-stock nav button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--so-muted); font-size: 12.5px; }
#workspace-phan-phoi .abi-stock nav button[aria-pressed="true"] { background: #fff; color: var(--so-ink); box-shadow: 0 1px 3px rgba(20, 20, 25, .12); }
#workspace-phan-phoi .abi-stock-table { background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .abi-stock-table th { position: sticky; top: 0; background: #F7F7F9; color: var(--so-ink); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
#workspace-phan-phoi .abi-stock-table :is(td, th) { padding: 10px 12px; border-bottom: 1px solid #F1F1F3; }
#workspace-phan-phoi .abi-stock-table tbody tr:hover td { background: var(--so-tint-2); }
#workspace-phan-phoi .abi-stock-form { padding: 14px 16px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .abi-stock-source { color: var(--so-muted); font-size: 12.5px; }

@media (max-width: 900px) { #workspace-phan-phoi .pp-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  #workspace-phan-phoi .pp-abi-grid tbody th { min-width: 132px; max-width: 150px; white-space: normal; }
  #workspace-phan-phoi .pp-tabs { padding: 12px 14px 0; }
  #workspace-phan-phoi .pp-sub { max-width: calc(100% - 28px); margin: 14px 14px 0; }
  #workspace-phan-phoi .dms-wrap, #workspace-phan-phoi .abi-trade-pay, #workspace-phan-phoi .abi-stock { padding-left: 14px; padding-right: 14px; }
  #workspace-phan-phoi .dms-counts, .pp-dialog .dms-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #workspace-phan-phoi .pp-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #workspace-phan-phoi .dms-counts b { font-size: 18px; }
  #workspace-phan-phoi .dms-head h1, #workspace-phan-phoi .dms-wrap > h1 { font-size: 19px; }
  #workspace-phan-phoi .pp-fbar { gap: 10px; }
  #workspace-phan-phoi .pp-cols { height: 190px; gap: 6px; }
  #workspace-phan-phoi .pp-trend text { font-size: 22px; }
  #workspace-phan-phoi .dms-wrap button:not(table button):not(.tf-btn), .pp-dialog button { min-height: 40px; }
}
#workspace-phan-phoi { min-height: 100vh; }
#workspace-phan-phoi .dms-counts:has(> div:nth-child(6):last-child), .pp-dialog .dms-counts:has(> div:nth-child(6):last-child) { grid-template-columns: repeat(auto-fit, minmax(max(160px, calc((100% - 24px) / 3)), 1fr)); }
#workspace-phan-phoi .dms-counts:has(> div:nth-child(7):last-child), #workspace-phan-phoi .dms-counts:has(> div:nth-child(8):last-child) { grid-template-columns: repeat(auto-fit, minmax(max(160px, calc((100% - 36px) / 4)), 1fr)); }
#workspace-phan-phoi .dms-wrap .dms-table :is([data-po], [data-receipt-open], [data-promotion], [data-foc-order]) { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--so-cobalt-h); font-weight: 700; text-align: left; }
#workspace-phan-phoi .dms-wrap .dms-table :is([data-po], [data-receipt-open], [data-promotion], [data-foc-order]):hover { background: none; text-decoration: underline; }
#workspace-phan-phoi .abi-stock .tf-btn { width: 20px; min-height: 20px; height: 20px; padding: 0; margin-left: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--so-soft); vertical-align: middle; }
#workspace-phan-phoi .abi-stock .tf-btn:hover { background: #EDEDF0; color: var(--so-ink); }
#workspace-phan-phoi .abi-stock header > .abi-stock-title { margin-right: auto; }
#workspace-phan-phoi .abi-stock header > .abi-stock-title h1 { margin: 0; }
#workspace-phan-phoi .tf-quick { padding: 10px 12px 6px; background: transparent; }
#workspace-phan-phoi .tf-quick-ic { display: none; }
#workspace-phan-phoi input[type=file] { max-width: 100%; padding: 5px 8px 5px 5px; border: 1px dashed #D4D4D8; border-radius: 10px; background: #fff; font: inherit; font-size: 13px; color: var(--so-muted); }
#workspace-phan-phoi input[type=file]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid #E4E4E7; border-radius: 8px; background: #fff; color: var(--so-ink); font: inherit; font-weight: 700; cursor: pointer; }
#workspace-phan-phoi [data-ps-root] h2 { color: var(--so-ink) !important; }
#workspace-phan-phoi [data-ps-root] thead th { background: #F7F7F9 !important; color: var(--so-ink) !important; }
#workspace-phan-phoi #ps-add { background: var(--so-cobalt) !important; border-color: var(--so-cobalt) !important; }
#workspace-phan-phoi .pp-report-grid table { table-layout: fixed; width: max-content; min-width: 100%; font-size: 12.5px; }
#workspace-phan-phoi .pp-report-grid col.pp-rep-lab { width: 300px; }
#workspace-phan-phoi .pp-report-grid col.pp-rep-kh, #workspace-phan-phoi .pp-report-grid col.pp-rep-tt { width: 140px; }
#workspace-phan-phoi .pp-report-grid col.pp-rep-pc { width: 64px; }
#workspace-phan-phoi .pp-report-pnl { margin: 16px 0; }
#workspace-phan-phoi .pp-rt-cost { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 6px; font-size: 13px; color: var(--so-muted); }
#workspace-phan-phoi .pp-rt-boc { margin: 0 0 16px; }
#workspace-phan-phoi .pp-rt-boc p { margin: 4px 0 8px; }
#workspace-phan-phoi .pp-report-pnl table { table-layout: auto; }
#workspace-phan-phoi .pp-report-pnl tbody th[scope="row"] { min-width: 300px; white-space: normal; }
#workspace-phan-phoi .pp-report-pnl td { min-width: 112px; }
#workspace-phan-phoi .pp-report-grid tbody th[scope="row"], #workspace-phan-phoi .pp-report-grid thead th.pp-rep-label { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; }
#workspace-phan-phoi .pp-report-grid tr.pp-rep-sec th { padding-top: 14px; background: #F4F6FB; font-weight: 800; text-align: left; }
#workspace-phan-phoi .pp-report-grid thead th[colspan] { border-left: 1px solid var(--so-line); text-align: center; }
#workspace-phan-phoi .pp-report-grid input { width: 100%; min-width: 0; min-height: 30px; padding: 3px 6px; text-align: right; }
#workspace-phan-phoi .pp-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
#workspace-phan-phoi .dms-wrap .pp-flow-step { --acc: var(--so-cobalt); position: relative; display: grid; justify-content: stretch; justify-items: start; align-content: start; gap: 4px; min-height: 0; padding: 14px 16px 14px 18px; border: 1px solid var(--so-line); border-radius: 16px; background: #fff; box-shadow: var(--so-sh); color: var(--so-ink); font-weight: 600; text-align: left; }
#workspace-phan-phoi .dms-wrap .pp-flow-step::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
#workspace-phan-phoi .pp-flow-step[data-pp-stage="cho_duyet"] { --acc: var(--so-amber); }
#workspace-phan-phoi .pp-flow-step[data-pp-stage="da_giao"] { --acc: #0E9F90; }
#workspace-phan-phoi .pp-flow-step[data-pp-stage="khac"] { --acc: var(--so-soft); }
#workspace-phan-phoi .pp-flow-step[data-pp-stage="huy"] { --acc: #DC2626; }
#workspace-phan-phoi .pp-flow-lb { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--so-muted); }
#workspace-phan-phoi .pp-flow-n { font-size: clamp(18px, 1.5vw, 24px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
#workspace-phan-phoi .pp-flow-n small { font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--so-muted); }
#workspace-phan-phoi .pp-flow-sub { font-size: 12.5px; color: var(--so-muted); }
#workspace-phan-phoi .pp-flow-v { font-size: 13.5px; font-weight: 800; }
#workspace-phan-phoi .crtpt-band-ord { background-color: var(--so-ink); }
#workspace-phan-phoi .crtpt-ordcol.crtpt-r0 { --col: rgba(24, 24, 27, .035); }
.pp-orders { width: min(1180px, 96vw); }
.pp-orders .dms-table td { vertical-align: top; }
.pp-ol { display: block; min-width: 200px; }
.pp-ol b { white-space: nowrap; }
.pp-ol + .pp-ol { margin-top: 3px; }
.pp-ol em { color: #6B6B72; font-size: 11.5px; font-style: normal; }
#workspace-phan-phoi .pp-don-f { align-items: flex-end; }
#workspace-phan-phoi .pp-don-f [data-sel] { display: contents; }
#workspace-phan-phoi .pp-don .dms-table td { vertical-align: top; }

/* 9af1fbac · Đối soát giao hàng + đơn vị giao ở Xếp chuyến */
#workspace-phan-phoi .pp-trip-partner { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-trip-partner select { min-height: 32px; padding: 0 8px; }
#workspace-phan-phoi .pp-recon .pp-group th small { display: block; margin-top: 4px; font-weight: 400; color: var(--so-ink); }
#workspace-phan-phoi .pp-file { display: inline-flex; align-items: center; min-height: 28px; margin: 0 4px 4px 0; padding: 0 10px; border: 1px solid var(--so-line); border-radius: 99px; background: #F7F7F9; color: var(--so-cobalt); font-size: 12px; font-weight: 700; cursor: pointer; }
#workspace-phan-phoi .pp-recon td .pp-chip + .pp-chip { margin-top: 4px; }
#workspace-phan-phoi .pp-recon .dms-table td { vertical-align: top; }
.pp-recon-dlg { padding: 16px 24px 24px; }

/* Kế hoạch tuần — tồn hiện tại + tồn cuối tuần / tháng (f47ab004): khung đỏ = thiếu hàng, cam = DOI dưới tồn tối thiểu; chỉ dòng tổng đầu dính đáy (3 dòng cùng dính thì đè nhau) */
#workspace-phan-phoi .pp-week-grid tfoot tr + tr > :is(th, td) { position: static; }
#workspace-phan-phoi .pp-week-grid:not(.pp-week-money) :is(tbody, tfoot) th { min-width: 150px; white-space: normal; }
#workspace-phan-phoi .pp-week-grid :is(.pp-stk, .pp-stk-sub) { white-space: normal; }
#workspace-phan-phoi .pp-week-grid :is(.pp-stk, .pp-stk-sub) > span { display: inline-block; white-space: nowrap; }
#workspace-phan-phoi .pp-week-grid .pp-stk { display: block; width: fit-content; margin: 4px 0 0 auto; padding: 4px 8px; border-radius: 8px; background: #F4F4F5; color: var(--so-ink); font-size: 13px; font-weight: 700; line-height: 1.4; }
#workspace-phan-phoi .pp-week-grid .pp-stk.warn { background: #FEF3C7; color: #B45309; }
#workspace-phan-phoi .pp-week-grid .pp-stk.bad { background: #FDE8EC; color: #C81E3A; }
#workspace-phan-phoi .pp-week-grid .pp-stk-sub { display: block; margin-top: 4px; color: var(--so-muted); font-size: 13px; font-weight: 400; }
/* Kế hoạch tuần — CK HĐ ABI dự kiến (d31851f3): thẻ Rebate tháng / ĐHHQ / quý / tổng (thay ô «Mốc tháng · Còn thiếu tới mốc»), chữ ≥ 13px; chênh lệch CK + kiểm ngày trong hộp thoại Plan ABI */
#workspace-phan-phoi .pp-rb { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
#workspace-phan-phoi .pp-rb > div { --acc: var(--so-cobalt); position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px 14px 18px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); color: var(--so-muted); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-rb > div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
#workspace-phan-phoi .pp-rb > .warn { --acc: #F59E0B; }
#workspace-phan-phoi .pp-rb > .bad { --acc: #DC2626; }
#workspace-phan-phoi .pp-rb h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-rb .pp-rb-v { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0; }
#workspace-phan-phoi .pp-rb .pp-rb-v b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--so-ink); }
#workspace-phan-phoi .pp-rb .pp-chip { font-size: 13px; }
#workspace-phan-phoi .pp-rb p { margin: 0; overflow-wrap: anywhere; }
#workspace-phan-phoi .pp-rb-sku small { font-size: 13px; }
.pp-dialog .pp-rb-delta { flex: 1 0 100%; margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--so-tint-2); color: var(--so-ink); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.pp-dialog .pp-rb-delta.bad { background: #FDE8EC; color: #7F1D1D; }
.pp-dialog .pp-rb-delta:empty { display: none; }

/* 1a77d446 · Giao hàng › Giao lẻ: chuyến đề xuất + bản đồ (Leaflet). Màu chuyến theo thứ tự categorical cobalt → amber → teal → violet → orange → ink. */
#workspace-phan-phoi .pp-route { --rt-1: #2563EB; --rt-2: #F59E0B; --rt-3: #0E9F90; --rt-4: #9B5DE5; --rt-5: #F2693C; --rt-6: #18181B; }
#workspace-phan-phoi .pp-route .dms-head .pp-actions label { display: inline-flex; align-items: center; gap: 8px; }
#workspace-phan-phoi .pp-route .dms-tabs { margin: 0; }
#workspace-phan-phoi .pp-rt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 16px; align-items: start; margin-top: 16px; }
#workspace-phan-phoi .pp-rt-mapbox { position: sticky; top: 12px; min-width: 0; }
#workspace-phan-phoi .pp-rt-map { height: min(72vh, 680px); overflow: hidden; background: #E9EEF5; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .pp-rt-map.pp-rt-pinning { cursor: crosshair; box-shadow: 0 0 0 3px rgba(37, 99, 235, .35); }
#workspace-phan-phoi .pp-rt-pinhint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--so-cobalt-h); }
#workspace-phan-phoi .pp-rt-trips { min-width: 0; }
#workspace-phan-phoi .pp-rt-trip { --rt: var(--rt-1); margin: 0 0 16px; border-left: 4px solid var(--rt); }
#workspace-phan-phoi .pp-rt-trip > header h3 { display: inline-flex; align-items: center; }
#workspace-phan-phoi .pp-rt-dot { display: inline-grid; flex: none; place-items: center; min-width: 24px; height: 24px; margin-right: 8px; padding: 0 4px; border-radius: 99px; background: var(--rt); color: #fff; font-size: 12.5px; font-style: normal; font-weight: 800; }
#workspace-phan-phoi .pp-rt-dot.pp-rt-c2 { color: var(--rt-6); }
#workspace-phan-phoi .pp-rt-trip td.pp-rt-who { min-width: 190px; }
#workspace-phan-phoi .pp-rt-trip td.pp-rt-addr { min-width: 230px; }
#workspace-phan-phoi .pp-rt-trip td.n { white-space: nowrap; }
#workspace-phan-phoi .pp-route :is(.dms-table small, .dms-table thead th, .pp-chip, .dms-counts span, .dms-tabs button, label, .pp-note-line) { font-size: 13px; }
#workspace-phan-phoi .pp-rt-meta { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--so-muted); font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-rt-meta b { color: var(--so-ink); }
#workspace-phan-phoi .pp-rt-w { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
#workspace-phan-phoi .pp-rt-veh { font-size: 13px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-rt-trip .dms-table { max-height: none; }
#workspace-phan-phoi .pp-rt-trip tr[draggable="true"] { cursor: grab; }
#workspace-phan-phoi .pp-rt-trip .dms-table select { width: 220px; min-height: 32px; padding: 2px 28px 2px 8px; font-size: 13px; }
#workspace-phan-phoi .pp-rt-new { margin: 0 0 16px; padding: 14px 16px; border: 2px dashed #C7D6FF; border-radius: 16px; color: var(--so-muted); font-size: 13px; font-weight: 700; text-align: center; }
#workspace-phan-phoi .pp-rt-over { background: var(--so-tint-2); box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }
#workspace-phan-phoi .pp-rt-pin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#workspace-phan-phoi .pp-rt-pin input { width: 240px; }
#workspace-phan-phoi .pp-rt-depot { display: grid; place-items: center; width: 40px; height: 24px; border-radius: 6px; background: var(--rt-6); color: #fff; font: 700 12px/1 'Public Sans', system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
#workspace-phan-phoi .pp-rt-pin-n { display: grid; place-items: center; min-width: 34px; height: 22px; padding: 0 4px; border: 2px solid #fff; border-radius: 99px; color: #fff; font: 700 11.5px/1 'Public Sans', system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
#workspace-phan-phoi .pp-rt-pin-n.approx { border-style: dashed; }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c1 { background: var(--rt-1); }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c2 { background: var(--rt-2); color: var(--rt-6); }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c3 { background: var(--rt-3); }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c4 { background: var(--rt-4); }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c5 { background: var(--rt-5); }
#workspace-phan-phoi .pp-rt-pin-n.pp-rt-c6 { background: var(--rt-6); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c1 { stroke: var(--rt-1); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c2 { stroke: var(--rt-2); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c3 { stroke: var(--rt-3); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c4 { stroke: var(--rt-4); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c5 { stroke: var(--rt-5); }
#workspace-phan-phoi .pp-rt-line.pp-rt-c6 { stroke: var(--rt-6); }
#workspace-phan-phoi .pp-rt-veh-t { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
#workspace-phan-phoi .pp-rt-vcard { display: grid; align-content: start; gap: 12px; padding: 16px; background: #fff; border: 1px solid var(--so-line); border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi .pp-rt-vcard > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
#workspace-phan-phoi .pp-rt-vcard > header b { font-size: 15px; font-weight: 800; }
#workspace-phan-phoi .pp-rt-vgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px 12px; }
#workspace-phan-phoi .pp-rt-vgrid label { align-content: start; }
#workspace-phan-phoi .pp-rt-vgrid .pp-rt-vwide { grid-column: 1 / -1; }
#workspace-phan-phoi .pp-rt-vgrid input { width: 100%; }
#workspace-phan-phoi .pp-rt-vgrid small { color: var(--so-muted); font-size: 13px; font-weight: 600; }
#workspace-phan-phoi .pp-rt-opts { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 16px; }
#workspace-phan-phoi .pp-route input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--so-cobalt); }
#workspace-phan-phoi .pp-route .dms-table td.n input { width: 108px; text-align: right; }
#workspace-phan-phoi .pp-rt-cfg input.pp-rt-w2 { width: 340px; }
#workspace-phan-phoi .pp-rt-cfg .pp-h2 { margin-top: 0; }
@media (max-width: 1599px) {
  #workspace-phan-phoi .pp-rt-grid { grid-template-columns: minmax(0, 1fr); }
  #workspace-phan-phoi .pp-rt-mapbox { position: static; order: -1; }
  #workspace-phan-phoi .pp-rt-map { height: 440px; }
}
@media (max-width: 700px) {
  #workspace-phan-phoi .pp-route .dms-head .pp-actions { width: 100%; }
  #workspace-phan-phoi .pp-rt-map { height: 320px; }
  #workspace-phan-phoi .pp-rt-cfg input.pp-rt-w2, #workspace-phan-phoi .pp-rt-pin input { width: 100%; }
}
/* 5196e460: chuyến chốt trên link kho — ai chốt / trạng thái; nút trạng thái trong thẻ chuyến; app có nút «Mở link kho» */
#workspace-phan-phoi .pp-rt-who-line { margin: 6px 0 0; font-size: 13px; color: var(--so-muted); }
#workspace-phan-phoi .pp-rt-who-line b { color: var(--so-ink); }
#workspace-phan-phoi .pp-rt-trip > header .pp-actions { margin-left: auto; }
#workspace-phan-phoi a.pp-rt-kholink { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 9px; background: var(--so-cobalt); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
#workspace-phan-phoi a.pp-rt-kholink[hidden] { display: none; }
#workspace-phan-phoi.ghr { overflow: visible; background: transparent; margin-top: 12px; }
#workspace-phan-phoi.ghr .dms-wrap { padding: 0; }
#workspace-phan-phoi.ghr .ghr-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; color: var(--so-muted); }
#workspace-phan-phoi.ghr .ghr-who b { color: var(--so-ink); }
#workspace-phan-phoi.ghr .ghr-name { display: grid; gap: 10px; max-width: 420px; padding: 16px; background: #fff; border-radius: 16px; box-shadow: var(--so-sh); }
#workspace-phan-phoi.ghr .ghr-name input { min-height: 44px; font-size: 16px; }
@media (max-width: 960px) {
  #workspace-phan-phoi.ghr .pp-rt-grid { grid-template-columns: minmax(0, 1fr); }
  #workspace-phan-phoi.ghr .pp-rt-mapbox { position: static; order: -1; }
  #workspace-phan-phoi.ghr .pp-rt-map { height: 46vh; }
}
@media (pointer: coarse) {
  #workspace-phan-phoi.ghr .dms-wrap :is(button, select, input:not([type=checkbox])) { min-height: 44px; font-size: 15px; }
  #workspace-phan-phoi.ghr .pp-rt-trip .dms-table select { min-height: 40px; }
}
#workspace-phan-phoi .pp-rt-trip small.pp-rt-sales { display: block; margin-top: 2px; color: var(--so-ink); font-size: 13px; }
#workspace-phan-phoi .pp-rt-trip small.pp-rt-sales a { color: var(--so-cobalt-h); font-weight: 700; }
#workspace-phan-phoi .pp-route [data-wh] { max-width: 340px; }
#workspace-phan-phoi.ghr .ghr-who button, #workspace-phan-phoi.ghr .ghs-q { min-height: 40px; padding: 0 14px; border: 1px solid #D4D4D8; border-radius: 9px; background: #fff; color: var(--so-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
#workspace-phan-phoi.ghr .ghs { display: grid; gap: 12px; }
#workspace-phan-phoi.ghr .ghs-q { width: 100%; max-width: 420px; font-weight: 500; cursor: text; font-size: 16px; min-height: 44px; }
#workspace-phan-phoi.ghr .ghs-g h3 { margin: 8px 0; font-size: 15px; }
#workspace-phan-phoi.ghr .ghs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
#workspace-phan-phoi.ghr .ghs-card { padding: 12px 14px; background: #fff; border-radius: 14px; box-shadow: var(--so-sh); font-size: 14px; }
#workspace-phan-phoi.ghr .ghs-card b { display: block; font-size: 15px; }
#workspace-phan-phoi.ghr .ghs-card small { display: block; color: var(--so-muted); font-size: 13px; }
#workspace-phan-phoi.ghr .ghs-card .act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#workspace-phan-phoi.ghr .ghs-card .act a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px; background: var(--so-tint); color: var(--so-cobalt-h); font-weight: 700; text-decoration: none; }
#workspace-phan-phoi.ghr .ghs-card .bad { color: #C81E3A; font-weight: 700; }
#workspace-phan-phoi .pp-rt-trip small.pp-rt-note { display: block; margin-top: 2px; color: #B45309; font-size: 13px; font-weight: 700; }
#workspace-phan-phoi .pp-rt-boc textarea { width: 100%; min-height: 120px; font: inherit; font-size: 14px; }
#workspace-phan-phoi .pp-rt-chk { display: block; font-size: 12.5px; font-weight: 800; }
#workspace-phan-phoi .pp-rt-chk.ok { color: #0F766E; }
#workspace-phan-phoi .pp-rt-chk.bad { color: #C81E3A; }
#workspace-phan-phoi .pp-rt-gom { display: block; color: var(--so-cobalt-h); }
#workspace-phan-phoi .pp-rt-trip button.pp-rt-metab { display: block; margin-top: 4px; min-height: 30px; padding: 0 10px; font-size: 12.5px; }
#workspace-phan-phoi .pp-rt-metarow > td { background: var(--so-tint-2); }
#workspace-phan-phoi .pp-rt-metaf { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(120px, 1fr)); gap: 8px; }
#workspace-phan-phoi .pp-rt-check { font-weight: 700; color: #0F766E; }
#workspace-phan-phoi .pp-rt-check.bad { color: #C81E3A; }
#workspace-phan-phoi .pp-trip-partner input[type=time] { width: 110px; }
/* 72b1cf35: link kho gọn — bảng kiểu Excel */
#workspace-phan-phoi .pp-mini .dms-table.pp-xl { max-height: 70vh; }
#workspace-phan-phoi .pp-xl thead th { position: sticky; top: 0; z-index: 1; background: #EEF2FB; white-space: nowrap; }
#workspace-phan-phoi .pp-xl tfoot td { position: sticky; bottom: 0; background: #FFF8DB; font-weight: 800; border-top: 2px solid #E5E7EB; }
#workspace-phan-phoi .pp-xl td.pp-xl-addr { min-width: 220px; }
#workspace-phan-phoi .pp-xl tr.pp-xl-sub td { border-top-style: dashed; }
#workspace-phan-phoi .pp-xl tr.pp-xl-un td { background: #FFF5F5; }
#workspace-phan-phoi .pp-xl select { min-width: 170px; }
#workspace-phan-phoi .pp-xl input[type=number] { width: 64px; }
#workspace-phan-phoi .pp-xl tr.pp-xl-grp td { background: #FFF6C7; }
/* 7dc0c513: Xếp cụm — mỗi cụm 1 khối (dòng tóm tắt + điểm giao), kéo thả điểm giao giữa các cụm */
#workspace-phan-phoi .pp-cum tbody.pp-cum-h > tr > td { padding: 8px 10px; background: #F4F6FA; box-shadow: inset 3px 0 0 var(--so-cobalt); border-top: 1px solid #DCE3F0; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-h.un > tr > td { background: #FFF5F5; box-shadow: inset 3px 0 0 #C81E3A; }
#workspace-phan-phoi .pp-cum-bar { position: sticky; left: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: calc(var(--cw, 100vw) - 44px); max-width: 100%; }
#workspace-phan-phoi .pp-cum-bar :is(select, input) { height: 32px; min-width: 0; }
#workspace-phan-phoi .pp-cum-bar select[data-csess] { width: 96px; }
#workspace-phan-phoi .pp-cum-bar select[data-cveh] { width: auto; max-width: 260px; }
#workspace-phan-phoi .pp-cum-name { width: 280px; font-weight: 700; }
#workspace-phan-phoi .pp-cum-lb { font-weight: 700; }
#workspace-phan-phoi .pp-cum-k { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--so-ink); }
#workspace-phan-phoi .pp-cum-why { font-size: 12.5px; color: var(--so-muted); }
#workspace-phan-phoi .pp-cum-act { display: flex; gap: 8px; margin-left: auto; }
#workspace-phan-phoi .pp-cum-act button { min-height: 32px; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-s td { vertical-align: top; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-s td:is(:nth-child(8), :nth-child(10)), #workspace-phan-phoi .pp-cum tbody.pp-cum-s tr + tr td:is(:nth-child(1), :nth-child(3)) { white-space: nowrap; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-s > tr:first-child > td { border-top: 1px solid #E5E7EB; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-s > tr + tr > td { border-top: 1px dashed #EEF0F3; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-s.gom > tr > td { background: #FFFBEA; }
#workspace-phan-phoi :is(.pp-cum, .pp-cum-tot) tr.pp-cum-sum td { font-weight: 700; background: #FAFAFB; }
#workspace-phan-phoi .pp-cum-tot tr.pp-cum-sum.pp-bad td { color: #C81E3A; }
#workspace-phan-phoi .pp-cum .pp-cum-stt { white-space: nowrap; }
#workspace-phan-phoi .pp-route .pp-cum td.pp-cum-stt input[type=number] { width: 60px; min-width: 0; vertical-align: middle; }
#workspace-phan-phoi .pp-cum-grip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; margin-right: 4px; border-radius: 6px; color: var(--so-muted); cursor: grab; vertical-align: middle; user-select: none; }
#workspace-phan-phoi .pp-cum-grip:hover { color: var(--so-cobalt); background: var(--so-tint-2); }
#workspace-phan-phoi .pp-cum tbody.pp-cum-drag { opacity: .45; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-before > tr:first-child > td { box-shadow: inset 0 3px 0 var(--so-cobalt); }
#workspace-phan-phoi .pp-cum tbody.pp-cum-after > tr:last-child > td { box-shadow: inset 0 -3px 0 var(--so-cobalt); }
#workspace-phan-phoi .pp-cum tbody.pp-rt-over > tr > td { background: var(--so-tint-2); }
#workspace-phan-phoi .pp-cum tbody.pp-cum-e td { padding: 14px; text-align: center; color: var(--so-muted); }
#workspace-phan-phoi .pp-cum tbody.pp-cum-new td { padding: 10px; border-top: 1px solid #E5E7EB; }
#workspace-phan-phoi .pp-cum tbody.pp-cum-new button { position: sticky; left: 10px; min-height: 34px; padding: 0 16px; border: 1px dashed #C7D6FF; border-radius: 8px; background: #fff; font-weight: 700; color: var(--so-cobalt); }
#workspace-phan-phoi .pp-cum-code { display: block; white-space: nowrap; }
#workspace-phan-phoi .pp-cum small.pp-bad { display: block; font-size: 12px; font-weight: 700; color: #C81E3A; }
#workspace-phan-phoi .pp-cum td.pp-cum-note { min-width: 200px; }
#workspace-phan-phoi .pp-mini .dms-table.pp-cum-tot { max-height: none; }
/* 7dc0c513: Vận chuyển (thẻ chuyến) + Hoàn thành (bảng + hộp xem lại) */
#workspace-phan-phoi .pp-vc-card { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #E4E4E7; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
#workspace-phan-phoi .pp-vc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 10px; border-bottom: 1px solid #EEF0F3; }
#workspace-phan-phoi .pp-vc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
#workspace-phan-phoi .pp-vc-meta { font-size: 12.5px; color: var(--so-muted); font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-vc-steps { display: flex; flex-wrap: wrap; gap: 6px; }
#workspace-phan-phoi .pp-vc-act { display: flex; gap: 8px; margin-left: auto; }
#workspace-phan-phoi .pp-vc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin: 12px 0; }
#workspace-phan-phoi .pp-vc-grid fieldset { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid #EEF0F3; border-radius: 8px; }
#workspace-phan-phoi .pp-vc-grid legend { padding: 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--so-muted); }
#workspace-phan-phoi .pp-vc-grid label { display: flex; flex: 1 1 120px; flex-direction: column; gap: 4px; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--so-muted); }
#workspace-phan-phoi .pp-vc-grid :is(input, select) { width: 100%; min-height: 34px; color: var(--so-ink); }
#workspace-phan-phoi .pp-vc-grid input[data-num] { text-align: right; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-vc-grid fieldset > :is(button, p) { flex: 1 1 100%; margin: 0; }
#workspace-phan-phoi .pp-vc-grid fieldset > button { flex: 0 0 auto; }
#workspace-phan-phoi .pp-vc-sum { font-size: 13px; font-variant-numeric: tabular-nums; }
#workspace-phan-phoi .pp-vc-grid small { color: var(--so-muted); font-size: 12px; }
:is(#workspace-phan-phoi, .pp-vc-detail) .pp-vc-files { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
:is(#workspace-phan-phoi, .pp-vc-detail) .pp-vc-file { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; width: 86px; min-height: 0; padding: 4px; border: 1px solid #E4E4E7; border-radius: 8px; background: #fff; font-size: 12px; cursor: pointer; }
:is(#workspace-phan-phoi, .pp-vc-detail) .pp-vc-file img { width: 76px; height: 56px; border-radius: 6px; background: #F4F4F5; object-fit: cover; }
:is(#workspace-phan-phoi, .pp-vc-detail) .pp-vc-file img:not([src]) { visibility: hidden; }
#workspace-phan-phoi .pp-vc-file.new { border-color: var(--so-cobalt); }
#workspace-phan-phoi .pp-vc-acct { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; }
#workspace-phan-phoi .pp-vc-acct input[data-acct-note] { flex: 1 1 160px; width: auto; min-height: 34px; }
#workspace-phan-phoi .pp-vc-grid label.pp-vc-up { position: relative; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: center; min-height: 34px; padding: 0 13px; border: 1px dashed #C7D6FF; border-radius: 9px; color: var(--so-cobalt); cursor: pointer; }
#workspace-phan-phoi .pp-vc-up input[type=file] { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; }
#workspace-phan-phoi .pp-vc-up:focus-within { box-shadow: 0 0 0 3px rgba(37, 99, 235, .3); }
#workspace-phan-phoi .pp-vc-dntt { font-size: 12.5px; color: var(--so-muted); }
#workspace-phan-phoi .pp-vc .pp-vc-orders { max-height: none; }
#workspace-phan-phoi .pp-vc-orders select { min-width: 150px; }
#workspace-phan-phoi .pp-vc .pp-actions label { display: inline-flex; align-items: center; gap: 6px; }
#workspace-phan-phoi .pp-ht tbody tr { cursor: pointer; }
#workspace-phan-phoi .pp-ht tbody tr:is(:hover, :focus-visible) td { background: var(--so-tint-2); }
#workspace-phan-phoi .pp-ht td small { display: block; font-size: 12px; color: var(--so-muted); }
.pp-vc-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pp-vc-detail .pp-vc-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin: 12px 0; }
.pp-vc-detail .pp-vc-dl dt { font-size: 12px; font-weight: 700; color: #71717A; }
.pp-vc-detail .pp-vc-dl dd { margin: 2px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
/* 7a8013d8: Weekly Report (Tổng quan & bán ra) */
#workspace-phan-phoi .pp-ov-switch button[aria-pressed="true"] { background: var(--so-cobalt); border-color: var(--so-cobalt); color: #fff; }
#workspace-phan-phoi .pp-wr-bar { justify-content: space-between; }
#workspace-phan-phoi .pp-wr-bar .dv2-stat { margin-left: auto; }
#workspace-phan-phoi .pp-wr-acts { display: flex; gap: 8px; }
#workspace-phan-phoi .pp-wr .pp-h2 { margin: 24px 0 10px; font-size: 17px; font-weight: 800; }
#workspace-phan-phoi .pp-wr .pp-h2 small { margin-left: 8px; font-size: 13px; font-weight: 600; color: var(--so-muted); }
#workspace-phan-phoi .pp-wr .dms-counts > div small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--so-muted); }
#workspace-phan-phoi .pp-wr tfoot tr.pp-sum td, #workspace-phan-phoi .pp-wr tr.pp-sum th, #workspace-phan-phoi .pp-wr tr.pp-sum td { font-weight: 800; background: #FAFAFB; }
#workspace-phan-phoi .pp-wr tr.pp-wr-st-bad td { background: #FDECEF; }
#workspace-phan-phoi .pp-wr tr.pp-wr-st-over td { background: #FFF4E5; }
#workspace-phan-phoi .pp-wr-chart rect.pp-wr-bar { fill: #BFD3FA; }
#workspace-phan-phoi .pp-wr-chart rect.pp-wr-bar.cur { fill: var(--so-cobalt); }
#workspace-phan-phoi .pp-wr-note ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--so-muted); line-height: 1.6; }
#workspace-phan-phoi .dv2-stat.warn { background: #FEF3C7; color: #B45309; }
#workspace-phan-phoi svg.pp-wr-chart { display: block; width: 100%; max-width: 760px; height: auto; margin: 4px auto 0; overflow: visible; font-family: inherit; }
#workspace-phan-phoi svg.pp-wr-chart .ax { stroke: #E4E4E7; stroke-width: 1; }
#workspace-phan-phoi svg.pp-wr-chart .tg { stroke: #A1A1AA; stroke-width: 1.5; stroke-dasharray: 6 5; }
#workspace-phan-phoi svg.pp-wr-chart .ln { fill: none; stroke: var(--so-ink); stroke-width: 2.5; }
#workspace-phan-phoi svg.pp-wr-chart circle { fill: #fff; stroke: var(--so-ink); stroke-width: 2; }
#workspace-phan-phoi svg.pp-wr-chart text { font-size: 12px; fill: var(--so-muted); text-anchor: middle; }
#workspace-phan-phoi svg.pp-wr-chart text.vl { font-weight: 700; fill: var(--so-ink); }

/* Weekly Report theo file họp tuần ABI_HopTuan (7a8013d8 trả lại 07/11): ô Kết luận vàng, Ghi chú, lưới chart, màu cột Plan ABI xám · Đề xuất xanh dương · KPI cam · Đơn 1 xanh lá */
#workspace-phan-phoi .wr-doc { max-width: 1180px; }
#workspace-phan-phoi .wr-doc-head h1 { margin: 6px 0 4px; font-size: 19px; font-weight: 800; }
#workspace-phan-phoi .wr-doc-head p, #workspace-phan-phoi .wr-sub { margin: 0 0 8px; font-size: 13px; color: var(--so-muted); }
#workspace-phan-phoi .wr-sec { margin-bottom: 8px; }
#workspace-phan-phoi .wr-h3 { margin: 14px 0 6px; font-size: 14.5px; font-weight: 800; }
#workspace-phan-phoi .wr-t { margin: 6px 0 10px; }
#workspace-phan-phoi .wr-t td.wr-ctkm { font-size: 12.5px; color: var(--so-muted); min-width: 260px; }
#workspace-phan-phoi .wr-c-plan { background: #F3F4F6; }
#workspace-phan-phoi .wr-c-prop { background: #EFF6FF; }
#workspace-phan-phoi .wr-c-kpi { background: #FFF7ED; }
#workspace-phan-phoi .wr-c-o1 { background: #ECFDF3; }
#workspace-phan-phoi .wr-charts { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 10px; }
#workspace-phan-phoi svg.wr-ch { display: block; flex: 0 1 auto; max-width: 100%; height: auto; border: 1px solid #F0F0F2; border-radius: 8px; }
#workspace-phan-phoi .wr-concl { background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 8px; padding: 8px 12px; margin: 6px 0 8px; font-size: 13.5px; line-height: 1.5; }
#workspace-phan-phoi .wr-note { font-size: 12.5px; color: #3F3F46; }
#workspace-phan-phoi .wr-note ul, #workspace-phan-phoi .wr-rules { margin: 4px 0 8px; padding-left: 18px; line-height: 1.55; font-size: 12.5px; }
#workspace-phan-phoi .wr-leg { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 6px; font-size: 12.5px; color: var(--so-muted); }
#workspace-phan-phoi .wr-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.wr-cfg-back { position: fixed; inset: 0; z-index: 9000; background: rgba(24, 24, 27, .45); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 32px 12px; }
.wr-cfg { background: #fff; border-radius: 12px; width: min(860px, 100%); padding: 16px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); font-size: 13px; }
.wr-cfg header { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 4px; }
.wr-cfg header button { border: 0; background: none; font-size: 22px; cursor: pointer; }
.wr-cfg h4 { margin: 14px 0 6px; font-size: 13.5px; }
.wr-cfg .wr-sub { color: #71717A; margin: 0 0 8px; }
.wr-cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 14px; }
.wr-cfg label { display: flex; flex-direction: column; gap: 3px; color: #3F3F46; }
.wr-cfg label.wr-cfg-w { margin-bottom: 6px; }
.wr-cfg input, .wr-cfg textarea { border: 1px solid #D4D4D8; border-radius: 6px; padding: 6px 8px; font: inherit; }
.wr-cfg textarea { width: 100%; box-sizing: border-box; }
.wr-cfg footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.wr-cfg .pp-err { color: #DC2626; }

/* 3ab4bdb4: Giao lẻ = màn kho (giao-hang.html?app=1) nhúng trong app, kho đăng nhập thao tác trực tiếp */
#workspace-phan-phoi iframe.pp-kho-frame { display: block; width: 100%; height: calc(100vh - 170px); min-height: 560px; border: 0; border-radius: 12px; background: #F4F4F5; }
@media (max-width: 760px) { #workspace-phan-phoi iframe.pp-kho-frame { height: calc(100vh - 120px); border-radius: 0; } }

/* 339d1e1d: mã DMS sau duyệt (ABISO…) cạnh mã sales lên đơn (ABISA…); chưa duyệt = «chờ duyệt» (cam nghiêng) */
#workspace-phan-phoi small.pp-so { display: block; color: var(--so-muted, #71717A); font-size: 12px; font-weight: 600; }
#workspace-phan-phoi small.pp-so.wait, #workspace-phan-phoi td.pp-so-wait, .pp-so-wait { color: #B45309; font-style: italic; }
