/* =============================================================================
 * biz-theme.css — Giao diện Module Kinh Doanh (VIZIO Biz).
 * ========================================================================== */

.biz-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 12px;
}

.biz-subnav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  flex-shrink: 0;
}

.biz-page-content {
  flex: 1;
  min-height: 0;
}

.biz-view-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 32px 2px;
}

/* Quick action button next to field labels (NCC, Danh mục, etc.) */
.biz-quick-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 16px;
}
.biz-quick-add-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}
.biz-quick-add-btn.active {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
.biz-quick-add-btn .ph {
  font-size: 12px;
  font-weight: 700;
}

/* Reset for general .btn-link across biz module */
.btn-link,
button.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}
.btn-link:hover,
button.btn-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.biz-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.biz-subnav-btn .ph {
  font-size: 16px;
  color: #94a3b8;
}
.biz-subnav-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}
.biz-subnav-btn:hover .ph {
  color: #475569;
}
.biz-subnav-btn.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  border-color: #e2e8f0;
}
.biz-subnav-btn.active .ph {
  color: #2563eb;
}

/* 3 Stock indicator badges */
.stock-badge-group {
  display: inline-flex;
  align-items: center;
  background: #f4f6f8;
  border-radius: 6px;
  padding: 2px 4px;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
}
.stock-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stock-val-phy {
  font-weight: 600;
  color: #344054;
}
.stock-val-hold {
  font-weight: 600;
  color: #d46b08;
}
.stock-val-avail {
  font-weight: 700;
  color: #0bcb6b;
}
.stock-val-avail.low {
  color: #fa8c16;
}
.stock-val-avail.zero {
  color: #f5222d;
}

/* POS Screen */
.pos-layout {
  display: flex;
  gap: 16px;
  min-height: calc(100vh - 110px);
  align-items: stretch;
}
.pos-catalog {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--fx-card-shadow);
  min-width: 0;
  overflow: hidden;
}
.pos-cart-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--fx-card-shadow);
  min-width: 360px;
  max-width: 480px;
  overflow-y: auto;
  min-height: 0;
}
.pos-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 155px;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  margin-top: 10px;
}
.pos-prod-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.pos-prod-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
  transform: translateY(-2px);
}
.pos-prod-card:active {
  transform: scale(0.97);
}

/* Trạng thái sản phẩm ĐÃ ĐƯỢC CHỌN trong giỏ hàng */
.pos-prod-card.in-cart {
  border-color: #0284c7;
  border-width: 1.5px;
  background: #f0f9ff;
  box-shadow: 0 0 0 1.5px #0284c7, 0 4px 12px rgba(2, 132, 199, 0.12);
}
.pos-prod-card.in-cart:hover {
  border-color: #0369a1;
  box-shadow: 0 0 0 2px #0284c7, 0 6px 16px rgba(2, 132, 199, 0.18);
}

/* Badge nổi góc trên phải báo đã chọn */
.pos-card-cart-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #0284c7;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.35);
  animation: posBadgePop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3;
  user-select: none;
}
@keyframes posBadgePop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pos-prod-thumb.thumb-in-cart {
  border: 1.5px solid #93c5fd;
}

/* Mini stepper trên footer thẻ sản phẩm */
.pos-card-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.2);
  height: 24px;
}
.pos-card-step-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}
.pos-card-step-btn:hover {
  background: #0284c7;
  color: #ffffff;
}
.pos-card-step-val {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* Nút icon thêm nhanh khi chưa chọn */
.pos-card-add-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
}
.pos-prod-card:hover .pos-card-add-icon {
  background: #0284c7;
  color: #ffffff;
  transform: scale(1.08);
}

.pos-prod-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.pos-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pos-prod-thumb .ph {
  font-size: 20px;
  color: #64748b;
}
.pos-prod-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 17px;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pos-prod-sku {
  font-size: 11px;
  color: #64748b;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.pos-prod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.pos-prod-price {
  font-weight: 700;
  color: #0284c7;
  font-size: 13.5px;
}
.pos-cart-del {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.pos-cart-del:hover {
  background: #fee2e2;
  color: #ef4444;
}
.pos-fast-cash {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.pos-fast-btn {
  flex: 1;
  min-width: 60px;
  padding: 4px 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.pos-fast-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #0284c7;
}
.pos-cart-list {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 0;
  margin: 6px 0;
}
.pos-cart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed #f0f2f5;
}
.pos-cart-info {
  flex: 1;
  min-width: 0;
}
.pos-cart-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-cart-price {
  font-size: 12px;
  color: var(--text-sub);
}
.pos-qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}
.pos-qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}
.pos-qty-btn:hover {
  background: var(--border-light);
}
.pos-qty-val {
  width: 32px;
  height: 26px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}
.pos-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-sub);
}
.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}
.pos-total-val {
  color: var(--primary);
  font-size: 18px;
}

/* POS Modern Checkout Summary & Composite Controls */
.pos-summary-card {
  margin-top: auto;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
  min-height: 25px;
}

.pos-summary-val {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
  font-size: 13.5px;
}

/* Composite Input Group (Input + Unit Toggle / Addon) */
.pos-input-composite {
  display: inline-flex;
  align-items: stretch;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pos-input-composite:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.pos-input-composite input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 76px;
  color: #0f172a;
  -moz-appearance: textfield;
}

.pos-input-composite input::-webkit-outer-spin-button,
.pos-input-composite input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Unit toggle segmented buttons */
.pos-unit-switch {
  display: flex;
  background: #f1f5f9;
  border-left: 1px solid #e2e8f0;
  padding: 2px;
  gap: 1px;
}

.pos-unit-btn {
  border: none;
  background: transparent;
  padding: 0 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-unit-btn:hover {
  color: #0f172a;
}

.pos-unit-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pos-unit-addon {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  user-select: none;
}

/* Discount preview tag */
.pos-discount-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* Total highlight banner */
.pos-total-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  margin: 4px 0;
}

.pos-total-banner-label {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pos-total-banner-val {
  font-size: 20px;
  font-weight: 800;
  color: #0284c7;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* Payment method tabs */
.pos-pay-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}

.pos-pay-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-pay-tab:hover {
  background: #f8fafc;
  color: #0f172a;
}

.pos-pay-tab.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

/* Change money banner */
.pos-change-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 12px;
  color: #15803d;
  margin-top: 4px;
}

.pos-change-val {
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* CrmPanel POS widget */
.crm-pos-box {
  background: #f8fafd;
  border: 1px solid #ddecfe;
  border-radius: 10px;
  padding: 10px;
  margin-top: 12px;
}
.crm-ai-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.15s;
}
.crm-ai-btn:hover {
  opacity: 0.92;
}

/* SVG Chart */
.biz-chart-bar {
  transition: height 0.3s ease, y 0.3s ease;
}
.biz-chart-bar:hover {
  fill: #3385ff !important;
}

/* Movement type badges */
.mvt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}
.mvt-import { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.mvt-export { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.mvt-adjust { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.mvt-order_hold { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
.mvt-order_deduct { background: #f0f5ff; color: #1d39c4; border: 1px solid #adc6ff; }
.mvt-order_release { background: #f9f0ff; color: #531dab; border: 1px solid #d3adf7; }
.mvt-order_return { background: #e6fffb; color: #08979c; border: 1px solid #87e8de; }

/* =============================================================================
 * VIZIO CRM ENTERPRISE STYLES
 * ========================================================================== */

.crm-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid #eaecf0;
  margin-top: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.crm-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.crm-tab-item:hover {
  color: #0f172a;
  background: transparent;
}
.crm-tab-item.active {
  color: #0068ff;
  font-weight: 600;
  background: transparent;
  border-color: transparent;
  border-bottom-color: #0068ff;
}
.crm-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.15s ease;
}
.crm-tab-item.active .crm-tab-badge {
  background: #eff6ff;
  color: #0068ff;
}

/* Source filters pills */
.crm-source-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow-x: auto;
}
.crm-source-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.crm-source-btn:hover {
  color: #0f172a;
  background: #edf2f7;
}
.crm-source-btn.active {
  background: #fff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Badges */
.crm-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.crm-badge-chat {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}
.crm-badge-excel {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1px solid #e9d5ff !important;
}
.crm-badge-manual {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}
.crm-badge-hot {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}
.crm-badge-warm {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}
.crm-badge-cold {
  background: #f0fdf4 !important;
  color: #16a34a !important;
  border: 1px solid #bbf7d0 !important;
}
.crm-badge-dnc {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  border: 1px solid #e5e7eb !important;
}

/* CRM Table & Actions */
.crm-table {
  width: 100% !important;
  border-collapse: collapse !important;
}
.crm-table th {
  padding: 11px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #475467 !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #eaecf0 !important;
  text-align: left !important;
  white-space: nowrap !important;
}
.crm-table td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
}
.crm-table tbody tr {
  transition: background 0.12s ease !important;
}
.crm-table tbody tr:hover {
  background: #f8fafc !important;
}
.crm-actions-cell {
  text-align: right !important;
  white-space: nowrap !important;
  width: 190px !important;
}
.crm-actions-group {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  white-space: nowrap !important;
}
.crm-actions-group .btn-sm {
  height: 30px !important;
  padding: 0 9px !important;
  font-size: 12.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
}
.crm-code-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  font-variant-numeric: tabular-nums !important;
  color: #0284c7 !important;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* Sales Workspace Drawer / Modal (3 Columns) */
.crm-ws-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}
.crm-ws-card {
  width: 95vw;
  max-width: 1380px;
  background: #f8fafc;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  overflow: hidden;
}
.crm-ws-head {
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.crm-ws-body {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 380px;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  min-height: 0;
}
.crm-ws-col {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.crm-ws-col-head {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}
.crm-ws-col-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Activity Timeline */
.crm-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 12px;
}
.crm-timeline::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #e2e8f0;
}
.crm-timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.crm-timeline-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0284c7;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.crm-timeline-content {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

/* Pipeline Kanban */
.crm-kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 550px;
}
.crm-kanban-col {
  width: 280px;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.crm-kanban-header {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  background: #fff;
  border-radius: 10px 10px 0 0;
}
.crm-kanban-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crm-deal-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.crm-deal-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
  transform: translateY(-2px);
}

/* Stepper Wizard */
.crm-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 16px;
}
.crm-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}
.crm-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.crm-step-item.active {
  color: #0284c7;
}
.crm-step-item.active .crm-step-num {
  background: #0284c7;
  color: #fff;
}
.crm-step-item.done {
  color: #16a34a;
}
.crm-step-item.done .crm-step-num {
  background: #16a34a;
  color: #fff;
}

/* Excel Hub & Dropzone Styles */
.btn-excel {
  background: #16a34a;
  border: 1px solid #16a34a;
  color: #ffffff;
  font-weight: 500;
  transition: all 0.15s ease;
}
.btn-excel:hover {
  background: #15803d;
  border-color: #15803d;
}
.crm-dropzone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.crm-dropzone:hover, .crm-dropzone.dragover {
  background: #f0fdf4;
  border-color: #16a34a;
}
.crm-hub-card {
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* =============================================================================
 * VIZIO BIZ & CRM: MODALS, FORMS & DIALOG DESIGN SYSTEM
 * ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1050;
  padding: 16px;
  animation: fxFadeIn 0.15s ease-out;
}

@keyframes fxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fxModalZoom {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-card {
  background: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  width: 100% !important;
  max-width: 600px;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border: 1px solid #eaecf0 !important;
  animation: fxModalZoom 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-header,
.modal-head {
  padding: 16px 22px !important;
  border-bottom: 1px solid #eaecf0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #ffffff !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.modal-header h3,
.modal-head h3 {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #101828 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.modal-header h3 .ph,
.modal-head h3 .ph {
  font-size: 18px !important;
  color: var(--primary, #0068ff) !important;
}

.btn-close,
.modal-header .btn-close,
.modal-head .btn-close {
  background: transparent !important;
  border: none !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.btn-close:hover,
.modal-header .btn-close:hover,
.modal-head .btn-close:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.modal-body {
  padding: 20px 24px !important;
  overflow-y: auto !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  box-sizing: border-box !important;
}

.modal-footer,
.modal-foot,
.fx-modal-foot {
  padding: 14px 24px !important;
  border-top: 1px solid #eaecf0 !important;
  background: #f8fafc !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* =============================================================================
 * FORM CONTROLS: INPUTS, SELECTS & TEXTAREAS
 * ========================================================================== */

.fx-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
}

.form-input:not([class*="w-"]),
.fx-input:not([class*="w-"]),
.form-textarea,
.fx-textarea,
.fx-select:not([class*="w-"]) {
  width: 100%;
  box-sizing: border-box !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  outline: none !important;
}

.form-input,
.fx-input,
.fx-select {
  height: 38px !important;
  padding: 0 12px !important;
  line-height: 38px !important;
}

.form-input.sm,
.fx-input.sm,
.fx-select.sm {
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  line-height: 32px !important;
}

.form-input:hover,
.fx-input:hover,
.form-textarea:hover,
.fx-textarea:hover,
.fx-select:hover {
  border-color: #94a3b8 !important;
}

.form-input:focus,
.fx-input:focus,
.form-textarea:focus,
.fx-textarea:focus,
.fx-select:focus {
  border-color: #0068ff !important;
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.12) !important;
}

.form-textarea,
.fx-textarea {
  min-height: 80px !important;
  padding: 10px 12px !important;
  line-height: 1.5 !important;
  resize: vertical !important;
}

.fx-select {
  cursor: pointer !important;
  padding-right: 32px !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
}

/* Two-column form grid */
.fx-form-grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
  width: 100% !important;
}

@media (max-width: 600px) {
  .fx-form-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Modal "Tạo Lead Form" — bước 2: nút Tải lại / Cấp quyền Lead Ads, ô Form ID + "Kiểm tra form", hộp báo lỗi */
.leadform-step-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.leadform-step-actions .btn,
.leadform-formid-row .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  white-space: nowrap;
}

.leadform-formid-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.leadform-formid-row .form-input {
  flex: 1 1 auto;
  min-width: 0;
}

.leadform-formid-row .btn {
  flex-shrink: 0;
}

.leadform-notice {
  font-size: 11.5px;
  line-height: 1.5;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.leadform-notice--error {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.leadform-notice--warn {
  color: #854d0e;
  background: #fefce8;
  border: 1px solid #fde68a;
}

.leadform-notice--ok {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.leadform-notice-sub {
  margin-top: 4px;
  color: #6b7280;
}

.leadform-notice-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Bulletproof safety cascade: All inputs/selects/textareas inside modals */
.modal-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 38px !important;
  padding: 0 12px !important;
  line-height: 38px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.modal-card select,
.modal-body select {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 38px !important;
  padding: 0 32px 0 12px !important;
  line-height: 38px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  outline: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Ô input có datalist gợi ý (Chức danh / Vị trí, Phòng ban...):
   Chuẩn hoá icon mũi tên dạng chevron mảnh SVG đồng bộ với select, ẩn tam giác đen mặc định của Chrome */
.modal-card input[list],
.modal-body input[list],
.form-input[list] {
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px !important;
}

.modal-card input[list]::-webkit-calendar-picker-indicator,
.modal-body input[list]::-webkit-calendar-picker-indicator,
.form-input[list]::-webkit-calendar-picker-indicator,
input[list]::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  width: 28px !important;
  height: 100% !important;
  cursor: pointer !important;
}

.modal-card textarea,
.modal-body textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 80px !important;
  padding: 10px 12px !important;
  line-height: 1.5 !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  outline: none !important;
  resize: vertical !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

/* =============================================================================
 * CRM CUSTOMER TOOLBAR: SOURCE BAR & FILTER CONTROLS (ALWAYS 1 ROW)
 * ========================================================================== */
.crm-filter-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-top: 6px !important;
  margin-bottom: 12px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.crm-filter-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  flex-wrap: nowrap !important;
}

.crm-search-box {
  display: inline-flex !important;
  align-items: center !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  height: 36px !important;
  width: 220px !important;
  padding: 0 10px !important;
  gap: 8px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
.crm-search-box:focus-within {
  border-color: #0068ff !important;
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.12) !important;
}
.crm-search-box .ph-magnifying-glass {
  font-size: 16px !important;
  color: #94a3b8 !important;
  flex-shrink: 0 !important;
}
.crm-search-box input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 13px !important;
  color: #1e293b !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
.crm-search-clear {
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  font-size: 14px !important;
}
.crm-search-clear:hover {
  color: #475569 !important;
}

.crm-filter-select {
  height: 36px !important;
  width: 145px !important;
  min-width: 140px !important;
  max-width: 160px !important;
  padding: 0 28px 0 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  outline: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%2364748b' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 11px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  flex-shrink: 0 !important;
}
.crm-filter-select:hover {
  border-color: #94a3b8 !important;
}
.crm-filter-select:focus {
  border-color: #0068ff !important;
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.12) !important;
}

@media (max-width: 980px) {
  .crm-filter-bar {
    flex-wrap: wrap !important;
  }
  .crm-filter-controls {
    margin-left: 0 !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  .crm-search-box {
    flex: 1 1 200px !important;
    width: auto !important;
  }
  .crm-filter-select {
    flex: 1 1 130px !important;
    width: auto !important;
  }
}

.modal-card input:focus,
.modal-body input:focus,
.modal-card select:focus,
.modal-body select:focus,
.modal-card textarea:focus,
.modal-body textarea:focus,
.biz-shell input:focus,
.biz-shell select:focus,
.biz-shell textarea:focus {
  border-color: #0068ff !important;
  box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.14) !important;
}

/* Modal action buttons styling */
.modal-footer .btn,
.modal-foot .btn,
.fx-modal-foot .btn {
  height: 38px !important;
  padding: 0 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

/* Responsive adjustments for 360 Workspace Drawer */
@media (max-width: 1200px) {
  .crm-ws-body {
    grid-template-columns: 300px 1fr 320px !important;
    gap: 12px !important;
    padding: 12px !important;
  }
}

@media (max-width: 992px) {
  .crm-ws-body {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }
  .crm-ws-col {
    min-height: 340px;
  }
}

/* Sleek thin scrollbars */
.crm-kanban-board::-webkit-scrollbar,
.crm-ws-col-scroll::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.crm-kanban-board::-webkit-scrollbar-thumb,
.crm-ws-col-scroll::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.crm-kanban-board::-webkit-scrollbar-track,
.crm-ws-col-scroll::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

/* Floating Bulk Actions Toolbar */
.crm-bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 50px;
  box-shadow: 0 12px 28px -4px rgba(2, 132, 199, 0.28), 0 8px 12px -6px rgba(0, 0, 0, 0.12);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  animation: slideUpBulk 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

@keyframes slideUpBulk {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.crm-bulk-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.crm-bulk-pill {
  background: #0284c7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
}

.crm-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .crm-bulk-bar {
    width: 92%;
    border-radius: 12px;
    flex-direction: column;
    gap: 10px;
    bottom: 12px;
    padding: 12px;
  }
  .crm-bulk-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* =============================================================================
/* Filter Toolbar (Search + Category Segment + Dropdown in One Single Row) */
.biz-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.biz-segmented-chips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  overflow-x: auto;
  max-width: 100%;
}

.biz-seg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.biz-seg-chip:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.biz-seg-chip.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.biz-seg-chip .biz-chip-count {
  font-size: 11px;
  opacity: 0.85;
}

/* Filter Chips (Categories & Suppliers) */
.biz-chips-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.biz-chips-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  margin-right: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.biz-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.biz-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.biz-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}
.biz-chip-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  cursor: pointer;
  transition: all 0.15s ease;
}
.biz-chip-clear:hover {
  background: #fee2e2;
}

/* Period Pills Selector (Day / Week / Month / Year) */
.biz-period-selector {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
  border: 1px solid #e2e8f0;
}
.biz-period-selector button,
.biz-period-btn {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.biz-period-selector button:hover,
.biz-period-btn:hover {
  color: #0f172a;
}
.biz-period-selector button.active,
.biz-period-btn.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Product Cards & Rich Inventory Items */
.biz-prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #94a3b8;
  overflow: hidden;
}
.biz-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.biz-prod-thumb.lg {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}
.biz-prod-thumb.sm {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

/* Stock Status Badges */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.stock-pill.out {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.stock-pill.low {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.stock-pill.good {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Debt Installment Payment Accordion */
.biz-debt-accordion {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
}
.biz-installment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 12.5px;
}
.biz-installment-item:last-child {
  border-bottom: none;
}

/* POS & Invoice Receipt Modal */
.biz-receipt-box {
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.biz-receipt-header {
  background: #1e293b;
  color: #ffffff;
  padding: 20px 24px;
}
.biz-receipt-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 24px;
}
.biz-receipt-body {
  padding: 20px 24px;
}
.biz-receipt-qr-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
}
.biz-receipt-qr-card img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

/* =============================================================================
 * Executive Clean & Smart SaaS Design (No Clutter, No Rainbow Colors)
 * ========================================================================== */

.biz-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1024px) {
  .biz-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .biz-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.biz-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.biz-kpi-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.biz-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.biz-kpi-title {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.biz-kpi-icon {
  font-size: 17px;
  color: #94a3b8;
}
.biz-kpi-value {
  font-size: 25px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.biz-kpi-value.green {
  color: #059669;
}
.biz-kpi-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.3;
}
.biz-kpi-sub b {
  color: #1e293b;
  font-weight: 600;
}
.biz-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 16px;
}
.biz-tag-pill.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.biz-tag-pill.warning {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}
.biz-tag-pill.danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.biz-tag-pill.neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Smart Operational Alert Strip */
.biz-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  margin-top: 14px;
}
.biz-action-strip-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}
.biz-action-btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.biz-action-btn-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.biz-action-btn-chip.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}
.biz-action-btn-chip.warning:hover {
  background: #fef3c7;
}
.biz-action-btn-chip.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.biz-action-btn-chip.danger:hover {
  background: #fee2e2;
}
.biz-action-btn-chip.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.biz-action-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.biz-text-action {
  font-size: 12.5px;
  font-weight: 500;
  color: #2563eb;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.biz-text-action:hover {
  background: #eff6ff;
}

/* Minimalist Bar Chart */
.biz-bar-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 180px;
  padding: 16px 8px 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}
.biz-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.biz-bar-stick {
  width: 38px;
  max-width: 80%;
  border-radius: 4px 4px 0 0;
  background: #2563eb;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}
.biz-bar-stick:hover {
  background: #1d4ed8;
  filter: brightness(1.08);
}
.biz-bar-stick.empty {
  background: #e2e8f0;
  height: 4px !important;
  border-radius: 2px;
  cursor: default;
}
.biz-bar-label {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.biz-bar-val-top {
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* In hóa đơn nhiệt POS 80mm */
@media print {
  body:has(#thermal-receipt) * {
    visibility: hidden !important;
  }
  #thermal-receipt,
  #thermal-receipt * {
    visibility: visible !important;
  }
  #thermal-receipt {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 80mm !important;
    max-width: 80mm !important;
    margin: 0 !important;
    padding: 8px !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: none !important;
    font-size: 12px !important;
  }
  .modal-overlay,
  .modal-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
  }
  .modal-header,
  .modal-footer,
  .btn,
  /* .fx-shell giữ hiển thị khi in hóa đơn nhiệt / báo cáo */
  .fx-nav,
  .fx-header {
    display: none !important;
  }
}

/* =============================================================================
 * BÁO CÁO KINH DOANH & TÀI CHÍNH THÔNG MINH (VIZIO BIZ SMART ANALYTICS)
 * ========================================================================== */

/* 1. Header & Quick Controls */
.biz-rep-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 2px;
}

.biz-rep-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.biz-rep-heading {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.biz-rep-heading i {
  color: #0284c7;
  font-size: 22px;
}

.biz-rep-caption {
  font-size: 12.5px;
  color: #64748b;
}

.biz-rep-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Segmented control chuyển kỳ */
.biz-segmented-control {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.biz-segmented-control button {
  background: transparent;
  border: none;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.biz-segmented-control button:hover {
  color: #0f172a;
}

.biz-segmented-control button.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 2. Dải Nhận Định Điều Hành Thông Minh (Smart Business Insight) */
.biz-smart-insight {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

.biz-smart-insight.positive {
  background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #bbf7d0;
}

.biz-smart-insight.neutral {
  background: linear-gradient(90deg, #f0f9ff 0%, #ffffff 100%);
  border-color: #bae6fd;
}

.biz-smart-insight-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.biz-smart-insight.positive .biz-smart-insight-icon {
  background: #dcfce7;
  color: #16a34a;
}

.biz-smart-insight.neutral .biz-smart-insight-icon {
  background: #e0f2fe;
  color: #0284c7;
}

.biz-smart-insight-body {
  flex: 1;
  min-width: 0;
}

.biz-smart-insight-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.biz-smart-insight-desc {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.45;
}

.biz-smart-insight-act {
  flex-shrink: 0;
}

/* 3. Bộ 3 thẻ tài chính cốt lõi (Financial Trio) */
.biz-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .biz-trio-grid {
    grid-template-columns: 1fr;
  }
}

.biz-trio-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.biz-trio-card:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.biz-trio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.biz-trio-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.biz-trio-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.biz-trio-pill.blue { background: #eff6ff; color: #1d4ed8; }
.biz-trio-pill.green { background: #ecfdf5; color: #047857; }
.biz-trio-pill.teal { background: #f0fdfa; color: #0f766e; }
.biz-trio-pill.gray { background: #f1f5f9; color: #475569; }

.biz-trio-main-val {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.biz-trio-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
}

.biz-dot {
  color: #cbd5e1;
  font-weight: 700;
}

/* Mini P&L Split Bar bên trong thẻ Lợi nhuận */
.biz-mini-pl-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.biz-mini-pl-bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.biz-mini-pl-profit {
  background: #10b981;
  height: 100%;
  transition: width 0.3s ease;
}

.biz-mini-pl-cogs {
  background: #f59e0b;
  height: 100%;
  transition: width 0.3s ease;
}

.biz-mini-pl-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

/* 4. Khối chính: Biểu đồ (65%) & Top Performers (35%) */
.biz-chart-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .biz-chart-stage-grid {
    grid-template-columns: 1fr;
  }
}

.biz-chart-box, .biz-top-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
}

.biz-chart-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.biz-box-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.biz-mini-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.biz-mini-toggle button {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.biz-mini-toggle button.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Vùng vẽ biểu đồ */
.biz-chart-render-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.biz-chart-meta-bar {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #f8fafc;
  border-radius: 6px;
}

.biz-chart-canvas {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 10px 10px 0;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.biz-chart-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #f1f5f9;
  pointer-events: none;
  z-index: 1;
}

.biz-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.biz-chart-col-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border-radius: 6px 6px 0 0;
  transition: all 0.25s ease;
  position: relative;
  cursor: pointer;
}

.biz-chart-col-bar.is-zero {
  background: #cbd5e1 !important;
  height: 4px !important;
  border-radius: 2px;
  opacity: 0.8;
}

.biz-chart-col-bar:hover {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  transform: scaleY(1.02);
}

.biz-chart-col-bar.is-zero:hover {
  background: #94a3b8 !important;
  transform: none;
}

.biz-chart-col-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65px;
  text-align: center;
}

.biz-chart-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.biz-chart-col-bar:hover .biz-chart-tip {
  opacity: 1;
}

/* Empty state biểu đồ tinh gọn */
.biz-clean-empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  padding: 16px;
}

.biz-empty-ghost-chart {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 40px;
  width: 120px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 2px;
}

.biz-empty-ghost-chart span {
  flex: 1;
  background: #e2e8f0;
  border-radius: 2px 2px 0 0;
}

/* Cột Phải: Top 5 Sản Phẩm Bán Chạy */
.biz-top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

.biz-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  transition: background 0.15s;
}

.biz-top-item:hover {
  background: #f1f5f9;
}

.biz-top-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.biz-top-rank.rank-1 { background: #fef3c7; color: #b45309; }
.biz-top-rank.rank-2 { background: #f1f5f9; color: #475569; }
.biz-top-rank.rank-3 { background: #ffedd5; color: #c2410c; }
.biz-top-rank.rank-4, .biz-top-rank.rank-5 { background: #ffffff; color: #94a3b8; border: 1px solid #e2e8f0; }

.biz-top-info {
  flex: 1;
  min-width: 0;
}

.biz-top-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biz-top-sub {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.biz-top-share {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  width: 60px;
  flex-shrink: 0;
}

.biz-share-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.biz-share-fill {
  height: 100%;
  background: #0284c7;
  border-radius: 999px;
}

.biz-share-num {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

/* 5. Khối Chi Tiết Chuyên Sâu (Details Tabbed Section) */
.biz-details-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.biz-details-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0 12px;
  overflow-x: auto;
  gap: 4px;
}

.biz-details-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.biz-details-tab:hover {
  color: #0f172a;
}

.biz-details-tab.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
  background: #ffffff;
}

.biz-details-content {
  padding: 18px 20px;
}




/* ==========================================================================
   SƠ ĐỒ TỔ CHỨC NHÂN SỰ (ORGANIZATION CHART) & QUẢN LÝ PHÂN CẤP
   ========================================================================== */

/* Segmented button chuyển đổi Danh sách / Sơ đồ */
.fx-view-segmented {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  gap: 3px;
  border: 1px solid #e2e8f0;
}
.fx-view-segmented .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  background: transparent;
  transition: all 0.15s ease;
}
.fx-view-segmented .btn.active,
.fx-view-segmented .btn.btn-primary {
  background: #ffffff !important;
  color: #0284c7 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.fx-view-segmented .btn:hover:not(.active):not(.btn-primary) {
  color: #0f172a;
}

/* Thanh công cụ Org Chart */
.fx-org-toolbar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fx-org-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.fx-org-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
}
.fx-org-stat-pill b {
  font-weight: 700;
  color: #0f172a;
}
.fx-org-stat-pill.primary {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}
.fx-org-stat-pill.primary b {
  color: #0284c7;
}

.fx-org-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.fx-org-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fx-org-dept-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.fx-org-dept-chip:hover {
  border-color: #0284c7;
  color: #0284c7;
}
.fx-org-dept-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}
/* Tổ chức nhân sự › "Lọc theo cơ sở" (chip kèm số nhân sự; điện thoại: ô chọn gọn) + ô "Cơ sở" của form nhân viên / panel
   sơ đồ (tích chọn nhiều cơ sở) + dòng cơ sở trong bảng — AccountPages.js, phần thuần ở org-chart.js. */
.sbr-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sbr-chip.is-none:not(.active) {
  border-style: dashed;
}
.sbr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sbr-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
.fx-org-dept-chip.active .sbr-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.sbr-filter .sbr-select {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  height: 36px;
}
.sbr-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: #0369a1;
}
.sbr-field {
  grid-column: 1 / -1;
  min-width: 0;
}
.sbr-label-note {
  font-weight: 400;
  font-size: 12px;
  color: #64748b;
}
.sbr-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sbr-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
}
.sbr-pick.on {
  border-color: #7dd3fc;
  background: #f0f9ff;
}
.sbr-pick.is-off {
  cursor: not-allowed;
  opacity: 0.7;
}
.sbr-pick input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  accent-color: #0284c7;
}
.sbr-pick-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.fx-org-search {
  max-width: 240px;
  height: 34px;
  font-size: 13px;
}
.fx-org-hint {
  font-size: 12.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #0284c7;
}

/* Canvas sơ đồ tổ chức */
.fx-org-canvas-wrap {
  background: radial-gradient(#e2e8f0 1.2px, transparent 1.2px), #f8fafc;
  background-size: 20px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 36px 20px 48px;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fx-org-roots {
  display: flex;
  justify-content: center;
  gap: 48px;
  align-items: flex-start;
  min-width: fit-content;
}

/* Nhánh và kết nối cây CSS */
.fx-org-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 28px;
}
.fx-org-branch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 28px;
  background: #94a3b8;
  transform: translateX(-50%);
}
.fx-org-branch::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #94a3b8;
}
.fx-org-branch:first-child::after {
  left: 50%;
  width: 50%;
}
.fx-org-branch:last-child::after {
  left: 0;
  width: 50%;
}
.fx-org-branch:only-child::after {
  display: none;
}
.fx-org-roots > .fx-org-branch {
  padding-top: 0;
}
.fx-org-roots > .fx-org-branch::before,
.fx-org-roots > .fx-org-branch::after {
  display: none;
}

.fx-org-children {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding-top: 28px;
  position: relative;
  min-width: fit-content;
}
.fx-org-children::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 28px;
  background: #94a3b8;
  transform: translateX(-50%);
}

/* Thẻ nhân sự Org Card */
.fx-org-card {
  width: 250px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  padding: 14px 14px 10px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  z-index: 2;
}
.fx-org-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
}
.fx-org-card.is-admin {
  border-top: 4px solid #0284c7;
}
.fx-org-card.is-inactive {
  opacity: 0.65;
  background: #f8fafc;
  border-style: dashed;
}

.fx-org-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fx-org-dept-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 6px;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fx-status-pill {
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
}
.fx-status-pill.active {
  color: #16a34a;
}
.fx-status-pill.inactive {
  color: #94a3b8;
}

.fx-org-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fx-avatar-letter.xl {
  width: 44px;
  height: 44px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #0284c7;
  border: 2px solid #e0f2fe;
  flex-shrink: 0;
}
.fx-avatar-letter.admin-avatar {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

.fx-org-details {
  min-width: 0;
  flex: 1;
}
.fx-org-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-org-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.fx-org-username {
  font-size: 11.5px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fx-org-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fx-org-card-tags .fx-tag {
  font-size: 11px;
  padding: 2px 7px;
  height: auto;
  border-radius: 4px;
}
.fx-tag-channel {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fx-org-children-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.15s;
}
.fx-org-children-toggle:hover {
  background: #e0f2fe;
}

.fx-org-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.fx-org-card-actions .fx-icon-btn.sm {
  width: 26px;
  height: 26px;
  font-size: 13px;
  border-radius: 6px;
}

/* Sơ đồ tổ chức quản trị được (oc-*, AccountPages): bấm thẻ mở panel sửa, nút nhanh, kéo thả đổi cấp trên (máy tính) */
.oc-card {
  cursor: pointer;
}
.oc-card:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}
.oc-card[draggable="true"] {
  cursor: grab;
}
.oc-tag-owner {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.oc-tag-perm {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-org-card-actions.oc-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.oc-qa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.oc-qa:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}
.oc-qa:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}
.oc-qa-add,
.oc-qa-wide {
  grid-column: 1 / -1;
}
.oc-qa-add {
  border-style: dashed;
  border-color: #93c5fd;
  background: #ffffff;
  color: #0369a1;
}
/* Kéo thả: thẻ đang kéo mờ đi; thẻ đích xanh = thả được, đỏ = không (kèm lý do nổi trên thẻ) */
.oc-canvas {
  position: relative;
}
.oc-canvas.oc-is-dragging .fx-org-card:hover {
  transform: none;
}
.oc-card.oc-dragging {
  opacity: 0.45;
}
.oc-card.oc-drop-ok {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.oc-card.oc-drop-no {
  border-color: #dc2626;
  border-style: dashed;
}
.oc-card.oc-drop-no[data-reason]::after {
  content: attr(data-reason);
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 6px);
  padding: 4px 8px;
  border-radius: 6px;
  background: #b91c1c;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
/* Hàng thẻ trên cùng: lý do hiện BÊN DƯỚI thẻ — phía trên là dải "cấp cao nhất" + mép khung (overflow cắt mất) */
.fx-org-roots > .fx-org-branch > .oc-card.oc-drop-no[data-reason]::after {
  top: calc(100% + 6px);
  bottom: auto;
}
.oc-root-drop {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border: 1.5px dashed #94a3b8;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
}
.oc-root-drop.is-over {
  border-color: #16a34a;
  color: #15803d;
  background: #f0fdf4;
}
.oc-root-drop.is-no {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fef2f2;
}
/* Panel sửa nhân sự: máy tính / tablet = drawer phải (như .fx-drawer); điện thoại = sheet đáy (media bên dưới) */
.oc-panel-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.45);
}
.oc-panel {
  width: 440px;
  max-width: 100vw;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: var(--fx-drawer-shadow, -6px 0 16px rgba(15, 23, 42, 0.08));
  animation: fxDrawerIn 0.2s ease-out;
  outline: none;
}
.oc-panel-grab {
  display: none;
}
.oc-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 14px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.oc-panel-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.oc-panel-who > b {
  font-size: 16px;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oc-panel-who > small {
  font-size: 12px;
  color: #94a3b8;
}
.oc-panel-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.oc-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.oc-panel-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}
.oc-sec {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
/* ô chọn có tên dài (bộ quyền, cấp trên) không được nới rộng panel quá màn hình */
.oc-sec > :is(.form-input, .fx-select) {
  min-width: 0;
  max-width: 100%;
}
/* Ô bị khoá vì không có quyền phải TRÔNG bị khoá (quy tắc chung ép nền trắng !important cho mọi ô / ô trong modal) */
.oc-panel :is(.form-input, .fx-select):disabled,
.fx-staff-modal select:disabled {
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}
.oc-sec.oc-flash {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}
.oc-sec-title {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.oc-sec-title .ph {
  font-size: 16px;
  color: #0284c7;
}
.oc-sec .fx-label {
  margin-top: 10px;
}
.oc-sec-title + .fx-label {
  margin-top: 4px;
}
.oc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  margin-top: 8px;
}
.oc-row .btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.oc-muted {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #64748b;
}
.oc-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oc-help {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #64748b;
}
.oc-help.is-warn,
.oc-help-span {
  color: #b45309;
}
.oc-help-span {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.oc-note {
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12.5px;
}
.oc-pwd {
  margin-top: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 8px;
  background: #f8fafc;
}
.oc-pwd .btn {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.oc-btn-danger {
  border: 1px solid #fecaca;
  background: #ffffff;
  color: #dc2626;
}
.oc-btn-danger:hover:not(:disabled) {
  border-color: #dc2626;
  background: #fef2f2;
}
/* Bị khoá (tài khoản chủ / admin tạo trước chủ, với người không phải chủ): mờ như .btn-secondary:disabled */
.oc-btn-danger:disabled {
  border-color: #e2e8f0;
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.25);
  cursor: not-allowed;
}
/* Hộp xác nhận kéo thả đổi cấp trên (nhận tiêu điểm khi mở để Esc đóng được — không vẽ viền tiêu điểm cho cả hộp) */
.oc-move-modal {
  outline: none;
}
.oc-move-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  color: #334155;
}
.oc-move-body p {
  margin: 0;
}
.oc-move-path {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}
.oc-move-node {
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
}
.oc-move-node.is-new {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #0369a1;
}
.oc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
/* Nghỉ việc / Bàn giao công việc (components/StaffHandoverModal.js) — nhận tiêu điểm khi mở để Esc đóng được */
.sh-modal {
  outline: none;
}
.sh-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
  color: #334155;
}
.sh-body p {
  margin: 0;
}
.sh-path {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}
.sh-person {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}
.sh-person.is-new {
  border-color: #0284c7;
  background: #f0f9ff;
}
.sh-person.is-empty {
  border-style: dashed;
  justify-content: center;
}
.sh-person-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.sh-person-txt b,
.sh-person-txt small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-person-txt small {
  font-size: 12px;
  color: #64748b;
}
.sh-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: #0284c7;
}
.sh-pick {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sh-pick .fx-select {
  flex: 1 1 auto;
  min-width: 0;
}
.sh-pick .btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.sh-preview {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.sh-preview-head {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.sh-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
}
.sh-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  transition: opacity 0.2s;
}
.sh-list.is-stale {
  opacity: 0.55;
}
.sh-list li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.sh-list li .ph {
  flex-shrink: 0;
  color: #0284c7;
}
.sh-list li span {
  flex: 1;
  min-width: 0;
}
.sh-list li b {
  flex-shrink: 0;
  color: #0f172a;
}
.sh-list li.is-zero {
  color: #94a3b8;
}
.sh-list li.is-zero .ph,
.sh-list li.is-zero b {
  color: #94a3b8;
}
.sh-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
}
.sh-note .ph {
  flex-shrink: 0;
  margin-top: 2px;
}
.sh-lock {
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
}
.sh-lock input {
  flex-shrink: 0;
  margin-top: 2px;
}
@keyframes oc-sheet-up {
  from {
    transform: translateY(100%);
  }
}
@media (max-width: 767px) {
  .oc-panel-mask {
    bottom: auto;
    height: var(--app-h, 100dvh);
    align-items: flex-end;
    justify-content: center;
  }
  .oc-panel {
    width: 100%;
    max-width: 560px;
    height: auto;
    max-height: calc(var(--app-h, 100dvh) - 48px);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(8, 28, 54, 0.18);
    animation: oc-sheet-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .oc-panel-grab {
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: #d0d5dd;
  }
  .oc-panel-head {
    padding: 8px 4px 10px 16px;
  }
  .oc-panel-head .fx-icon-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
  .oc-panel-body {
    padding: 12px 16px 16px;
  }
  .oc-panel-foot {
    padding: 10px 16px;
  }
  .oc-panel-foot .btn {
    flex: 1;
    height: 48px;
    font-size: 15px;
  }
  .oc-panel .form-input,
  .oc-panel .fx-select {
    height: 44px !important;
    line-height: 44px !important;
    font-size: 16px !important;
  }
  .oc-row .btn {
    min-height: 40px;
  }
  .oc-qa {
    height: 36px;
    font-size: 12px;
  }
  .sh-path {
    flex-direction: column;
    align-items: stretch;
  }
  .sh-arrow {
    align-self: center;
    transform: rotate(90deg);
  }
  .sh-pick {
    flex-wrap: wrap;
  }
  .sh-pick .fx-select {
    flex-basis: 100%;
    height: 44px;
    font-size: 16px;
  }
  .sh-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .oc-panel {
    animation: none;
  }
}
/* Danh mục tổ chức (components/OrgCatalogPanel.js): drawer .oc-panel rộng hơn, tab Phòng ban / Chức danh / Cơ sở */
.ocat-panel {
  width: 520px;
}
.ocat-head-ico {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f0f9ff;
  color: #0284c7;
  font-size: 20px;
}
.ocat-tabs {
  flex-shrink: 0;
  margin: 0;
  padding: 0 20px;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ocat-tabs button {
  white-space: nowrap;
  font-size: 13.5px;
}
.ocat-hint {
  margin: 0;
}
.ocat-add,
.ocat-edit {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ocat-add .form-input,
.ocat-edit .form-input {
  flex: 1 1 auto;
  min-width: 0;
}
.ocat-add .btn,
.ocat-edit .btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ocat-edit {
  flex: 1 1 auto;
}
.ocat-warn {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ocat-warn .ph {
  flex-shrink: 0;
  margin-top: 2px;
}
.ocat-empty {
  padding: 16px 4px;
}
.ocat-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ocat-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 8px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}
.ocat-item.is-editing {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}
.ocat-item.is-deleting {
  border-color: #fecaca;
  background: #fffafa;
}
.ocat-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ocat-move {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.ocat-move .fx-icon-btn {
  width: 26px;
  height: 20px;
  font-size: 13px;
}
.ocat-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
}
.ocat-name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.ocat-name > b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: #0f172a;
}
.ocat-name > small {
  font-size: 12px;
  color: #64748b;
}
.ocat-right {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
  font-size: 11.5px;
}
.ocat-del {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 2px 32px;
}
.ocat-del p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #7f1d1d;
}
.ocat-del-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ocat-manage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-style: dashed;
  color: #0284c7;
}
@media (max-width: 767px) {
  .ocat-panel {
    width: 100%;
  }
  .ocat-tabs {
    padding: 0 16px;
  }
  .ocat-move .fx-icon-btn {
    width: 40px;
    height: 24px;
    font-size: 15px;
  }
  .ocat-row > .fx-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  .ocat-add .btn,
  .ocat-edit .btn,
  .ocat-del-actions .btn {
    min-height: 44px;
  }
  .ocat-edit {
    flex-wrap: wrap;
  }
  .ocat-edit .form-input {
    flex-basis: 100%;
  }
  .ocat-del {
    padding-left: 4px;
  }
  .ocat-del-actions .btn {
    flex: 1;
  }
}


/* ==========================================================================
   QUẢN LÝ BỘ QUYỀN TRUY CẬP (RBAC - PERMISSION SETS)
   ========================================================================== */

.fx-permset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.fx-permset-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.fx-permset-card:hover {
  border-color: #0284c7;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
}
.fx-permset-card.is-system {
  border-left: 4px solid #0284c7;
}

.fx-permset-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.fx-permset-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.fx-permset-dept {
  font-size: 12px;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
}
.fx-permset-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  flex: 1;
}
.fx-permset-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #475569;
}
.fx-permset-actions {
  display: flex;
  gap: 4px;
}

/* Modal Bộ quyền chi tiết */
.fx-modal-xl.fx-perm-modal {
  max-width: 1060px !important;
  width: 95vw !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
}
.fx-perm-modal-body {
  overflow-y: auto !important;
  max-height: calc(92vh - 130px) !important;
  padding: 18px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

.fx-perm-form-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 768px) {
  .fx-perm-form-top {
    grid-template-columns: 1fr;
  }
}

.fx-perm-quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.fx-perm-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fx-perm-quick-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s;
}
.fx-perm-quick-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.fx-perm-quick-btn.primary {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}

.fx-perm-matrix {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fx-perm-cat-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}
.fx-perm-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.fx-perm-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: #0f172a;
}
.fx-perm-cat-title i {
  font-size: 16px;
  color: #0284c7;
}

.fx-perm-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
  gap: 16px;
}
.fx-perm-task-row:last-child {
  border-bottom: none;
}
.fx-perm-task-row:hover {
  background: #f8fafc;
}

.fx-perm-task-meta {
  flex: 1;
  min-width: 0;
}
.fx-perm-task-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}
.fx-perm-task-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}

.fx-perm-task-boxes {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.fx-perm-box-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
  min-width: 58px;
}
.fx-perm-box-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0284c7;
}
.fx-perm-box-item.disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.fx-perm-row-all {
  font-size: 11px;
  color: #0284c7;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
}
.fx-perm-row-all:hover {
  background: #e0f2fe;
}

/* ==========================================================================
   QUẢN LÝ NGƯỜI DÙNG & PHÂN QUYỀN KÊNH (MODAL REDESIGN)
   ========================================================================== */

.fx-usermgmt-modal {
  /* 1040px (trước 960px): bảng 5 cột có 3 cột rộng cố định (vai trò 250 · trạng thái 110 · thao tác 220) nên cột
     "Kênh được dùng" chỉ còn bề rộng tối thiểu — thêm chỗ để 2 tên kênh đầu hiện đủ hơn. Màn < 1095px vẫn 95vw. */
  max-width: 1040px !important;
  width: 95vw !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18) !important;
}

.fx-usermgmt-body {
  overflow-y: auto !important;
  padding: 20px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

.fx-usermgmt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.fx-usermgmt-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fx-usermgmt-tab {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.fx-usermgmt-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.fx-usermgmt-tab.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Hai cách xem của modal: "Theo nhân viên" (bảng tài khoản) / "Theo page" (PageStaffView) — dùng lại nút .fx-usermgmt-tab */
.aps-view-switch {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
}

.fx-usermgmt-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-usermgmt-search input {
  height: 34px;
  font-size: 13px;
  border-radius: 8px;
  width: 240px;
}

.fx-badge-ch-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
}

/* Ô "Kênh được dùng" GỌN (components/UserChannelSummary.js — modal này + bảng Tổ chức nhân sự):
   "8 kênh" + 2 tên đầu (cắt gọn) + "+6", bấm mở popover đủ danh sách. Thay danh sách chip dọc cũ: cột kênh bị
   các cột rộng cố định ép hẹp nên mỗi kênh thành 1 dòng → hàng rất cao khi nhân viên được giao nhiều Fanpage. */
.uc-sum-btn {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 280px;
  margin: 0;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.uc-sum-btn:hover,
.uc-sum-btn[aria-expanded="true"] {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.uc-sum-btn:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.uc-sum-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0284c7;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.uc-sum-name,
.uc-sum-more {
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

/* Tên kênh: 1 dòng, dài thì "…" (xem đủ ở popover / title). Dùng line-clamp + overflow-wrap:anywhere thay cho
   nowrap để chip CO ĐƯỢC theo cột (bề rộng tối thiểu ~1 ký tự): nowrap tính trọn chiều dài tên vào bề rộng tối thiểu
   của cột → bảng 8 cột ở trang Tổ chức nhân sự tràn ngang thêm. */
.uc-sum-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  min-width: 0;
  max-width: 132px;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.uc-sum-more {
  flex-shrink: 0;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.uc-sum-tail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.uc-sum-all,
.uc-sum-none {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.uc-sum-all {
  background: #f1f5f9;
  color: #475569;
}

.uc-sum-none {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Popover đủ danh sách: Teleport ra body, position fixed, z 1050 (.fx-popover) > modal 1000 */
.fx-popover.uc-sum-pop {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 16px);
  max-height: min(440px, calc(var(--app-h, 100vh) - 16px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  outline: none;
}

.uc-sum-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px 8px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.uc-sum-pop-head > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.uc-sum-pop-head b {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.uc-sum-pop-head small {
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uc-sum-pop-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0 8px;
}

.uc-sum-pop-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.uc-sum-pop-group .fx-ch-ico.xs,
.uc-pick-group-head .fx-ch-ico.xs {
  margin: 0;
  vertical-align: 0;
}

.uc-sum-pop-gcount {
  margin-left: auto;
  font-weight: 500;
}

.uc-sum-pop-item {
  padding: 4px 14px 4px 38px;
  font-size: 13px;
  line-height: 18px;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.uc-sum-pop-foot {
  padding: 8px 14px 10px;
  border-top: 1px solid #e2e8f0;
}

.uc-sum-pop-foot .btn {
  width: 100%;
}

/* Huy hiệu nền tảng cho mã kênh không còn trong danh sách kênh của công ty (nhóm "Khác") */
.fx-ch-ico.uc-ico-unknown {
  background: #94a3b8;
}

.fx-ch-edit-tr > td {
  padding: 0 !important;
  background: #f8fafc !important;
}

.fx-ch-edit-card {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px solid #0284c7;
  background: #f0f9ff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fx-ch-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.fx-ch-edit-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-ch-edit-note {
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.fx-ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.fx-ch-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fx-ch-select-card:hover {
  border-color: #94a3b8;
  background: #fafafa;
}

.fx-ch-select-card.active {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 1px #0284c7, 0 2px 6px rgba(2, 132, 199, 0.12);
}

.fx-ch-select-card input[type="checkbox"] {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #0284c7;
}

.fx-ch-select-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

/* Tên kênh hiện đủ: xuống tối đa 2 dòng (trước đây 1 dòng + "…" nên "ChungAuto.vn Phú…" mất phần phân biệt các
   Fanpage); dài hơn nữa thì rê chuột xem tên đầy đủ (title trên thẻ). */
.fx-ch-select-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  color: #1e293b;
}

/* Nhãn nền tảng dễ đọc ("Facebook", "Zalo cá nhân"…) thay cho type thô viết hoa ("FACEBOOK_PAGE") */
.fx-ch-select-type {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}

/* "Xem hội thoại của nhân viên khác" theo page (UserManagement.js): ô kênh + công tắc "cả của người khác" ngay dưới
   (chỉ hiện khi page đang được chọn), ghi chú giải thích phía trên lưới. */
.uvo-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.uvo-see {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  min-height: 28px;
  padding: 2px 10px 2px 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.uvo-see input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 17px;
  margin: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.uvo-see input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.uvo-see input[type="checkbox"]:checked {
  background: #0284c7;
}

.uvo-see input[type="checkbox"]:checked::after {
  transform: translateX(13px);
}

.uvo-see input[type="checkbox"]:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

.uvo-see.uvo-on {
  color: #0369a1;
}

.uvo-see.uvo-locked,
.uvo-see.uvo-locked input[type="checkbox"] {
  cursor: default;
}

.uvo-see.uvo-locked {
  opacity: 0.75;
}

.uvo-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  font-size: 12px;
  line-height: 1.5;
  color: #0c4a6e;
}

.uvo-note .ph {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 14px;
  color: #0284c7;
}

@media (max-width: 768px) {
  .uvo-see {
    min-height: 36px;
  }
}

/* Khối chọn kênh: đếm "Đã chọn x/y", ô tìm + chọn / bỏ chọn hàng loạt theo danh sách đang lọc, nhóm theo nền tảng */
.uc-pick-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12.5px;
  white-space: nowrap;
}

.uc-pick-count b {
  font-weight: 700;
}

.uc-pick-count.uc-zero {
  border-color: #fde68a;
  background: #fef3c7;
  color: #b45309;
}

.uc-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fx-search.uc-pick-search {
  flex: 1 1 240px;
  min-width: 0;
  padding-right: 4px;
}

/* Khung tìm kiếm page trong ô chọn "Page được dùng" (PagePickField.js):
   container .aps-pick có flex-direction: column nên cần flex-basis cố định 36px thay vì 240px */
.aps-pick .aps-pick-search,
.fx-search.aps-pick-search {
  flex: 0 0 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ô chữ nằm TRONG khung .fx-search: bỏ khung riêng mà luật chung ".modal-card input:not(…)" (!important) gắn cho
   mọi ô trong modal — không thì thành 2 lớp viền. Độ ưu tiên (0,5,1) > (0,4,1) của luật chung. */
.fx-search.uc-pick-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.fx-search.aps-pick-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  flex: 1;
  align-self: stretch;
  width: auto !important;
  min-width: 0;
  height: auto !important;
  padding: 0 !important;
  line-height: normal !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.uc-pick-clear {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.uc-pick-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uc-pick-filter-note {
  font-size: 12px;
  color: #475569;
}

.uc-pick-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.uc-pick-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uc-pick-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 13px;
  color: #0f172a;
}

.uc-pick-group-head b {
  font-weight: 600;
}

.uc-pick-group-count {
  font-size: 12px;
  color: #64748b;
}

.uc-pick-group-btn {
  margin-left: auto;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #0284c7;
  font-size: 12.5px;
  cursor: pointer;
}

.uc-pick-group-btn:hover {
  background: #e0f2fe;
}

/* Ô "Page được dùng" khi tạo nhân viên (PagePickField.js — form Thêm nhân viên / Thêm cấp dưới / Thêm tài khoản):
   danh sách tích chọn gọn, nhóm theo nền tảng, cuộn trong khung; trên form 2 cột thì chiếm cả hàng (.aps-pick-span). */
.aps-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aps-pick-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.aps-pick-bulk {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.aps-pick-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.aps-pick-group {
  padding: 8px 2px 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.aps-pick-group:first-child {
  padding-top: 2px;
}

.aps-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  cursor: pointer;
}

.aps-pick-row:hover {
  background: #f1f5f9;
}

.aps-pick-row.on {
  background: #f0f9ff;
}

.aps-pick-row input[type="checkbox"],
.aps-page-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #0284c7;
  cursor: pointer;
}

.aps-pick-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.aps-pick-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: #64748b;
}

.aps-pick-span {
  grid-column: 1 / -1;
  min-width: 0;
}

.aps-pick-admin {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #475569;
}

/* "Nhân viên của page" (PageStaffView.js — Phân quyền kênh › Theo page): chọn page + tìm, danh sách nhân viên của page
   (bỏ tích = sẽ gỡ, dòng mờ + nhãn đỏ), mục thêm nhân viên khác (nhãn xanh), chân có Hoàn tác / Lưu. */
.aps-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aps-page-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: end;
  gap: 8px 12px;
}

.aps-page-pick {
  min-width: 0;
}

.fx-search.aps-page-search {
  height: 38px;
}

.aps-page-sec {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aps-page-more {
  align-self: flex-start;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aps-page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 6px;
}

.aps-page-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.aps-page-row:hover {
  border-color: #bae6fd;
}

.aps-page-row.is-off {
  background: #fef2f2;
  border-color: #fecaca;
}

.aps-page-row.is-off .aps-page-who,
.aps-page-row.is-off .fx-avatar-letter {
  opacity: 0.6;
}

.aps-page-row.is-on {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.aps-page-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.aps-page-who b {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.aps-page-who small {
  font-size: 11.5px;
  color: #64748b;
  overflow-wrap: anywhere;
}

.aps-page-flag {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.aps-page-flag.is-remove {
  background: #fee2e2;
  color: #b91c1c;
}

.aps-page-flag.is-add {
  background: #e0f2fe;
  color: #0369a1;
}

.aps-page-admins {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12.5px;
  color: #475569;
}

.aps-page-admins .ph {
  flex-shrink: 0;
  margin-top: 2px;
  color: #0284c7;
}

.aps-page-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.aps-page-state {
  margin-right: auto;
  font-size: 12.5px;
  color: #64748b;
}

/* Bảng tài khoản tràn ngang (màn hẹp / điện thoại): khối chọn kênh dính mép trái và rộng đúng khung nhìn của bảng
   (100cqw của .uc-table-wrap) thay vì trải theo bề rộng cả bảng — không phải kéo ngang mới thấy hết thẻ kênh. */
.uc-table-wrap {
  container-type: inline-size;
}

/* Dòng phụ dưới tên nhân viên ("@0900… · Cửa hàng trưởng (Store Manager)") được xuống dòng: trước đây ép 1 dòng làm
   cột "Nhân viên" rộng ~340px, bảng tràn ~135px khỏi modal 960px → nút "Kênh" (mở khối chọn kênh) bị khuất bên phải. */
.uc-table-wrap .fx-cell-user small {
  white-space: normal;
}

.uc-edit-card {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  width: 100cqw;
}

.fx-add-user-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.fx-add-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
}

.fx-add-user-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fx-add-user-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.fx-add-user-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  padding-top: 12px !important;
  margin-top: 4px !important;
  border-top: 1px solid #e2e8f0 !important;
}

@media (max-width: 768px) {
  .fx-add-user-grid {
    grid-template-columns: 1fr;
  }

  /* Điện thoại: khối chọn kênh bớt lề; vùng chạm ≥ 40–44px cho ô tìm kênh, nút chọn nhóm và thẻ kênh;
     2 nút chọn / bỏ chọn tất cả chung 1 hàng khi đủ chỗ, hẹp quá thì mỗi nút 1 hàng (không tràn chữ) */
  .uc-edit-card {
    padding: 12px;
  }

  .fx-search.uc-pick-search {
    flex-basis: 100%;
    height: 44px;
  }

  .aps-pick .aps-pick-search,
  .fx-search.aps-pick-search {
    flex: 0 0 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }

  .fx-search.uc-pick-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .fx-search.aps-pick-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    font-size: 16px !important;
  }

  .uc-pick-clear {
    width: 36px;
    height: 36px;
  }

  .uc-pick-bulk {
    flex: 1 1 100%;
  }

  .uc-pick-bulk .btn {
    flex: 1 1 150px;
  }

  .uc-pick-group-btn {
    min-height: 36px;
  }

  /* Nhân viên của page / ô "Page được dùng": 1 cột, vùng chạm ≥ 44px, chân Lưu xếp gọn */
  .aps-view-switch {
    align-self: stretch;
  }

  .aps-view-switch .fx-usermgmt-tab {
    flex: 1;
    justify-content: center;
    min-height: 40px;
  }

  .aps-page-bar {
    grid-template-columns: 1fr;
  }

  .fx-search.aps-page-search {
    height: 44px;
  }

  .aps-pick-row,
  .aps-page-row {
    min-height: 44px;
  }

  .aps-pick-row input[type="checkbox"],
  .aps-page-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .aps-page-foot .btn {
    flex: 1 1 140px;
  }

  .fx-ch-select-card {
    min-height: 52px;
  }

  .uc-sum-btn {
    min-height: 32px;
  }
}

/* ================= CRM CHANNEL BAR (LIVE CHAT STYLE) ================= */
.crm-channel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.crm-channel-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.crm-channel-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}

.crm-channel-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.crm-channel-tab.active {
  background: #f0fdf4;
  border-color: #86efac;
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.12);
}

.crm-channel-tab.active .crm-ch-name {
  color: #166534;
  font-weight: 700;
}

.crm-ch-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
}

.crm-ch-icon-wrap.all {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 16px;
}

.crm-ch-icon-wrap.zalo {
  background: #0068ff;
  color: #ffffff;
}

.crm-ch-icon-wrap.fb {
  background: #1877f2;
  color: #ffffff;
}

.crm-ch-icon-wrap.oa {
  background: #0d9488;
  color: #ffffff;
}

.crm-ch-icon-wrap.other {
  background: #f3e8ff;
  color: #9333ea;
  font-size: 16px;
}

.crm-ch-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.crm-ch-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.crm-ch-dot.online {
  background: #22c55e;
}

.crm-ch-dot.warn {
  background: #f59e0b;
}

.crm-ch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-ch-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-ch-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-ch-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
}

.crm-ch-warn-pill {
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 0 6px;
  white-space: nowrap;
}

.crm-channel-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  background: #ffffff;
  border: 1.5px solid #0284c7;
  color: #0284c7;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-sync-btn:hover {
  background: #f0f9ff;
}

/* CRM Channel Pill inside Table */
.crm-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  max-width: 170px;
}

.crm-ch-pill-name {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-unassigned-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-assign-now-btn {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  border-radius: 5px !important;
}

.crm-reassign-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.crm-reassign-btn:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #cbd5e1;
}

