/* 3.19.0 — Employee Enterprise Console
   Lớp giao diện này được nạp sau các stylesheet cũ để nâng cấp riêng trải nghiệm
   nhân viên mà không thay đổi màn hình quản trị hay công thức nghiệp vụ. */

:root {
  --employee-blue: #0b78e3;
  --employee-blue-dark: #075eaf;
  --employee-blue-soft: #eaf5ff;
  --employee-green: #07865f;
  --employee-green-soft: #eaf8f2;
  --employee-ink: #14283b;
  --employee-muted: #63798d;
  --employee-line: #d7e4ee;
  --employee-surface: #ffffff;
  --employee-shadow: 0 10px 28px rgba(25, 62, 91, .08);
}

/* Tìm kiếm dùng chung cho chuyến giao và công nợ. */
.employee-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--employee-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 7px 20px rgba(28, 65, 94, .05);
}

.employee-search-box {
  display: flex;
  min-width: 0;
  height: 48px;
  align-items: center;
  border: 1px solid #c7d8e5;
  border-radius: 14px;
  background: #fff;
  padding-left: 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.employee-search-box:focus-within {
  border-color: #55a9ef;
  box-shadow: 0 0 0 4px rgba(11, 120, 227, .12);
}

.employee-search-box > span {
  flex: 0 0 auto;
  color: #71899d;
  font-size: 1.45rem;
  line-height: 1;
}

.employee-search-box input {
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 9px;
  font-size: 1rem;
}

.employee-search-box input:focus {
  border: 0;
  box-shadow: none;
}

.employee-search-box button {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin-right: 4px;
  border: 0;
  border-radius: 11px;
  background: #edf3f7;
  color: #566f83;
  font-size: 1.3rem;
  cursor: pointer;
}

.employee-search-box button.is-visible { display: grid; place-items: center; }

.employee-search-count {
  min-width: 72px;
  border-radius: 999px;
  background: var(--employee-blue-soft);
  padding: 9px 11px;
  color: var(--employee-blue-dark);
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

/* Khung ứng dụng nhân viên. */
.staff-mode {
  color: var(--employee-ink);
  background:
    radial-gradient(circle at 12% -6%, rgba(114, 196, 255, .30), transparent 25rem),
    linear-gradient(180deg, #f7fbfe 0, #f1f6fa 36rem, #eef4f8 100%);
}

.staff-mode .shell {
  width: min(760px, 100%);
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: calc(44px + env(safe-area-inset-bottom));
}

.staff-mode .header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 16px;
}

.staff-mode .brand { min-width: 0; }
.staff-mode .brand > div { min-width: 0; }
.staff-mode .brand small {
  display: block;
  overflow: hidden;
  color: var(--employee-blue);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode .brand h1 {
  overflow: hidden;
  margin-top: 3px;
  color: #10243a;
  font-size: 1.35rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode .logo {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0c82ed, #086bcd);
  box-shadow: 0 10px 22px rgba(8, 120, 239, .24);
}

.staff-mode .account-button {
  min-width: 106px;
  max-width: 126px;
  min-height: 50px;
  border-color: #cbdde9;
  border-radius: 15px;
  padding: 7px 11px;
  box-shadow: 0 6px 16px rgba(27, 64, 91, .06);
}

.staff-mode .account-button span {
  max-width: 102px;
  color: #17344c;
  font-size: .9rem;
}

.staff-mode .account-button small {
  margin-top: 2px;
  color: #6b8093;
  font-size: .7rem;
  letter-spacing: 0;
}

/* Bốn mục chính luôn vừa một hàng, không bị cuộn hoặc cắt chữ trên iPhone. */
.staff-mode .tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  top: 0;
  gap: 4px;
  margin: 0;
  padding: 5px;
  border: 1px solid #d5e2ec;
  border-radius: 17px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 24px rgba(28, 65, 94, .07);
}

.staff-mode .tabs .tab {
  display: grid;
  min-width: 0;
  min-height: 48px;
  place-items: center;
  border-radius: 12px;
  padding: 0 5px;
  color: #64798c;
  font-size: .83rem;
  line-height: 1.1;
  white-space: nowrap;
}

.staff-mode .tabs .tab.active {
  background: linear-gradient(180deg, #edf7ff, #e5f3ff);
  color: var(--employee-blue);
  box-shadow: inset 0 0 0 1px rgba(59, 151, 228, .12);
}

.staff-mode .view { margin-top: 14px; }

/* Ngày làm việc. */
.staff-mode #overview > .toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 11px 13px;
  border-color: var(--employee-line);
  border-radius: 18px;
  box-shadow: var(--employee-shadow);
}

.staff-mode #overview > .toolbar small {
  color: var(--employee-blue);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .1em;
}

.staff-mode #overview > .toolbar small::after { display: none; content: none; }
.staff-mode #overview > .toolbar strong {
  overflow: hidden;
  margin-top: 4px;
  color: #263f56;
  font-size: .9rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode #overview > .toolbar input {
  width: 148px;
  max-width: none;
  height: 44px;
  border-radius: 13px;
  font-size: .9rem;
  font-weight: 750;
}

/* Cụm thao tác đầu ca: rõ nghĩa, vùng chạm lớn, không có nút vỡ dòng. */
.staff-command-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 12px;
}

.staff-command {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 64px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--employee-line);
  border-radius: 17px;
  background: #fff;
  padding: 8px 11px;
  color: var(--employee-ink);
  text-align: left;
  box-shadow: 0 6px 18px rgba(27, 64, 91, .055);
  cursor: pointer;
}

.staff-command > span:last-child { display: grid; min-width: 0; gap: 3px; }
.staff-command strong { font-size: .93rem; line-height: 1.1; }
.staff-command small {
  overflow: hidden;
  color: #6a8093;
  font-size: .75rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-command-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #eef4f8;
  color: #3f6684;
  font-size: 1.25rem;
  font-weight: 850;
}

.staff-command-primary {
  border-color: transparent;
  background: linear-gradient(145deg, #0b80ea, #076bcf);
  color: #fff;
  box-shadow: 0 10px 24px rgba(8, 112, 216, .22);
}

.staff-command-primary .staff-command-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.staff-command-primary small { color: rgba(255, 255, 255, .82); }
.staff-command-money { border-color: #c9e7da; background: linear-gradient(145deg, #f4fcf8, #fff); }
.staff-command-money .staff-command-icon { background: var(--employee-green-soft); color: var(--employee-green); }

/* Tổng quan ca làm. */
.staff-mode .staff-workflow {
  margin: 0 0 12px;
  padding: 15px;
  border-color: #cfe0eb;
  border-radius: 22px;
  box-shadow: var(--employee-shadow);
}

.staff-mode .staff-workflow-head {
  align-items: center;
  gap: 10px;
  margin: 0 0 12px !important;
}

.staff-mode .staff-workflow-head > div { min-width: 0; }
.staff-mode .staff-workflow-head small { font-size: .75rem !important; letter-spacing: .11em; }
.staff-mode .staff-workflow-head h2 {
  overflow: hidden;
  margin-top: 4px;
  font-size: 1.08rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode #staff-profile-pill {
  max-width: 42%;
  overflow: hidden;
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode .staff-link-warning { font-size: .82rem; }
.staff-mode .staff-shift-hero {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 19px;
  background: linear-gradient(140deg, #075fab 0%, #0a7be0 62%, #2b93ee 100%);
  box-shadow: 0 13px 28px rgba(7, 101, 185, .2);
}

.staff-mode .staff-shift-hero::after {
  position: absolute;
  right: -32px;
  bottom: -54px;
  width: 150px;
  height: 150px;
  border: 26px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.staff-mode .staff-shift-hero > div { position: relative; z-index: 1; }
.staff-mode .staff-shift-hero small { font-size: .75rem; letter-spacing: .11em; }
.staff-mode .staff-shift-hero strong {
  margin-top: 8px;
  font-size: clamp(1.8rem, 8vw, 2.45rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.staff-mode .staff-shift-hero p {
  max-width: 440px;
  margin-top: 10px;
  font-size: .78rem;
  line-height: 1.45;
}

.staff-mode .staff-shift-status {
  position: relative;
  z-index: 1;
  padding: 8px 10px;
  font-size: .75rem;
}

.staff-mode .staff-day-kpis {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.staff-mode .staff-day-kpis article {
  min-height: 80px;
  border-color: #dce7ee;
  border-radius: 15px;
  padding: 12px;
}

.staff-mode .staff-day-kpis article:last-child { grid-column: 1 / -1; min-height: 72px; }
.staff-mode .staff-day-kpis small {
  color: #6b8093;
  font-size: .7rem;
  line-height: 1.25;
  letter-spacing: .07em;
}

.staff-mode .staff-day-kpis strong {
  margin-top: 8px;
  overflow: visible;
  color: #193b57;
  font-size: .98rem;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
}

.staff-money-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.staff-money-primary article {
  display: grid;
  min-width: 0;
  min-height: 104px;
  align-content: start;
  border: 1px solid #dbe7ef;
  border-radius: 15px;
  background: #fff;
  padding: 12px;
}

.staff-money-primary article:last-child { grid-column: 1 / -1; min-height: 94px; background: #f4f9fd; }
.staff-money-primary small {
  color: #6b8093;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.3;
}

.staff-money-primary strong {
  overflow-wrap: anywhere;
  margin-top: 9px;
  color: #163a58;
  font-size: 1.1rem;
  line-height: 1.15;
}

.staff-money-primary article:first-child strong { color: var(--employee-blue-dark); }
.staff-money-primary article:nth-child(2) strong { color: #7a5a08; }
.staff-money-primary article:last-child strong { color: var(--employee-green); }
.staff-money-primary span {
  overflow: hidden;
  margin-top: 7px;
  color: #718598;
  font-size: .75rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-mode .staff-settlement-more {
  margin-top: 9px;
  border-radius: 14px;
  padding: 0 11px;
}

.staff-mode .staff-settlement-more > summary {
  display: block;
  min-height: 46px;
  padding: 14px 2px;
  font-size: .82rem;
}

.staff-mode .staff-reconcile-strip {
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 0 0 7px;
}

.staff-mode .staff-reconcile-strip article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 58px;
  border: 1px solid #e0e9ef;
  border-radius: 12px;
  padding: 9px 11px;
}

.staff-mode .staff-reconcile-strip small { font-size: .78rem; }
.staff-mode .staff-reconcile-strip strong {
  margin: 0;
  overflow: visible;
  font-size: .86rem;
  text-overflow: clip;
}

.staff-mode .staff-reconcile-strip span {
  grid-column: 1 / -1;
  margin: 0;
  overflow: visible;
  font-size: .7rem;
  text-overflow: clip;
  white-space: normal;
}

.staff-mode .staff-detail-ledger { grid-template-columns: 1fr; gap: 7px; }
.staff-mode .staff-detail-ledger > div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 58px;
  padding: 9px 11px;
}

.staff-mode .staff-detail-ledger span { font-size: .78rem; }
.staff-mode .staff-detail-ledger strong { font-size: .86rem; }
.staff-mode .staff-detail-ledger small {
  grid-column: 1 / -1;
  overflow: visible;
  font-size: .7rem;
  text-overflow: clip;
  white-space: normal;
}

.staff-mode .staff-shift-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 84px;
  gap: 10px;
  margin-top: 9px;
  border-radius: 15px;
  padding: 11px 12px;
}

.staff-mode .staff-shift-readiness small { font-size: .75rem; }
.staff-mode .staff-shift-readiness strong { margin-top: 4px; font-size: .88rem; }
.staff-mode .staff-shift-readiness p { margin-top: 4px; font-size: .75rem; line-height: 1.4; }
.staff-mode .staff-shift-checks { display: grid; max-width: none; justify-items: end; gap: 5px; }
.staff-mode .staff-shift-checks span { padding: 6px 8px; font-size: .75rem; }

/* Chi phí và nhật ký. */
.staff-mode .staff-expense-panel,
.staff-mode .overview-journal {
  border-color: #d5e3ed;
  border-radius: 20px !important;
  box-shadow: var(--employee-shadow);
}

.staff-mode .staff-expense-panel { padding: 14px !important; }
.staff-mode .staff-expense-panel .section-head { align-items: center; }
.staff-mode .staff-expense-panel .section-head small,
.staff-mode .overview-journal .section-head small { font-size: .7rem; }
.staff-mode .staff-expense-panel .section-head h2,
.staff-mode .overview-journal .section-head h2 { font-size: 1.02rem; }
.staff-mode .staff-expense-panel .btn { min-height: 44px; padding: 0 12px; font-size: .78rem; }
.staff-mode .staff-expense-details > summary { min-height: 44px; padding: 13px 10px; font-size: .78rem; }
.staff-mode .staff-edit-note { padding: 10px 11px; font-size: .75rem; line-height: 1.45; }
.staff-mode .overview-journal { padding: 14px 15px; }
.staff-mode .overview-journal-filters { gap: 7px; margin-bottom: 9px; }
.staff-mode .overview-journal-filters button {
  min-height: 38px;
  padding: 0 13px;
  font-size: .75rem;
}

.staff-mode .journal-entry {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 82px;
  padding: 10px 0;
}

.staff-mode .journal-kind-icon { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; }
.staff-mode .journal-entry-title > strong { font-size: .88rem; }
.staff-mode .journal-entry-body > small { margin-top: 2px; font-size: .7rem; }
.staff-mode .journal-entry-body > p { max-width: none; font-size: .75rem; line-height: 1.35; }
.staff-mode .journal-entry-side { min-width: 88px; }
.staff-mode .journal-entry-side > strong { font-size: .78rem; }
.staff-mode .journal-entry-actions .edit,
.staff-mode .journal-entry-actions .delete { min-height: 36px; padding: 6px 9px; font-size: .7rem; }
.staff-mode .overview-show-all { min-height: 44px; font-size: .78rem; }

/* Trang giao hàng: sửa triệt để lỗi tiêu đề/nút bị chia thành ba cột. */
.staff-mode #deliveries .page-head::after { display: none; content: none; }
.staff-mode .delivery-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--employee-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--employee-shadow);
}

.staff-mode .delivery-page-head > div { min-width: 0; }
.staff-mode .delivery-page-head small { color: var(--employee-blue); font-size: .75rem; letter-spacing: .11em; }
.staff-mode .delivery-page-head h2 { margin-top: 4px; font-size: 1.25rem; }
.staff-mode .staff-page-note {
  max-width: 430px;
  margin: 5px 0 0;
  color: #667d90;
  font-size: .75rem;
  line-height: 1.35;
}

.staff-mode .delivery-create-button {
  min-width: 126px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: .85rem;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(8, 120, 239, .18);
}

.staff-mode #deliveries .employee-search-panel {
  position: sticky;
  z-index: 4;
  top: 62px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.staff-mode #delivery-list .entry-list { gap: 10px; }
.staff-mode #delivery-list .entry {
  overflow: hidden;
  border-color: #d7e4ed;
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--employee-shadow);
}

.staff-mode #delivery-list .entry-top { align-items: flex-start; }
.staff-mode #delivery-list .entry-top > div:first-child { min-width: 0; }
.staff-mode #delivery-list .entry h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #142b40;
  font-size: 1rem;
  line-height: 1.3;
}

.staff-mode #delivery-list .entry-badge { margin-left: 0; padding: 5px 8px; font-size: .75rem; }
.staff-mode #delivery-list .entry-date { display: block; margin-top: 5px; font-size: .75rem; line-height: 1.35; }
.staff-mode #delivery-list .entry-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.staff-mode #delivery-list .entry-actions .edit,
.staff-mode #delivery-list .entry-actions .delete { min-height: 40px; padding: 7px 10px; font-size: .75rem; }
.staff-mode #delivery-list .entry-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.staff-mode #delivery-list .entry-values > div {
  border: 1px solid #e0e9ef;
  border-radius: 13px;
  background: #f8fbfd;
  padding: 10px;
}

.staff-mode #delivery-list .entry-values .products { grid-column: 1 / -1; background: #f3f9fe; }
.staff-mode #delivery-list .entry-values small { font-size: .7rem; }
.staff-mode #delivery-list .entry-values strong { margin-top: 5px; font-size: .82rem; line-height: 1.45; }
.staff-mode #delivery-list .entry-people,
.staff-mode #delivery-list .payment-method,
.staff-mode #delivery-list .muted { font-size: .75rem; line-height: 1.45; }

/* Công nợ: tổng quan trước, tìm nhanh sau, từng khách có nút thu rõ ràng. */
.staff-mode .debt-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-color: #f0d1d4;
  border-radius: 21px;
  background: linear-gradient(145deg, #fff4f4, #fff);
  box-shadow: var(--employee-shadow);
}

.staff-mode .debt-hero small { font-size: .75rem; letter-spacing: .1em; }
.staff-mode .debt-hero strong { font-size: 1.8rem; }
.staff-mode .debt-hero p { margin-top: 5px; font-size: .82rem; }
.staff-mode .debt-hero .btn { width: auto; min-width: 126px; min-height: 48px; font-size: .82rem; white-space: nowrap; }
.staff-mode #debt-list { grid-template-columns: 1fr; gap: 10px; }
.staff-mode #debt-list .debtor {
  min-height: 88px;
  border-color: #d9e5ed;
  border-radius: 18px;
  padding: 13px 14px;
  box-shadow: var(--employee-shadow);
}

.staff-mode #debt-list .debtor > div:first-child { min-width: 0; }
.staff-mode #debt-list .debtor > div:first-child strong { color: #17324a; font-size: .92rem; }
.staff-mode #debt-list .debtor .muted { margin: 5px 0 0; font-size: .76rem; }
.staff-mode #debt-list .debtor > div:last-child { display: grid; justify-items: end; gap: 7px; }
.staff-mode #debt-list .debtor > div:last-child > strong { font-size: .9rem; white-space: nowrap; }
.staff-mode #debt-list .debtor .edit { min-width: 82px; min-height: 40px; color: #fff; background: var(--employee-green); font-size: .75rem; font-weight: 800; }

/* Danh bạ và sản lượng: tăng độ đọc so với bản compact cũ. */
.staff-mode #customers .page-head {
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 2px;
}

.staff-mode #customers .page-head small { display: block; font-size: .75rem; }
.staff-mode #customers .page-head h2 { font-size: 1.25rem; }
.staff-mode #customers .page-head .btn { min-height: 46px; padding: 0 13px; font-size: .8rem; white-space: nowrap; }
.staff-mode .customer-search-panel-compact {
  position: sticky;
  top: 62px;
  z-index: 4;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 18px;
  box-shadow: var(--employee-shadow);
}

.staff-mode .customer-search-panel-compact .customer-search-box { height: 48px; }
.staff-mode .customer-search-panel-compact .customer-search-box input { height: 46px; font-size: 1rem; }
.staff-mode .customer-search-panel-compact .customer-search-count { min-width: 68px; padding: 8px 9px; font-size: .75rem; }
.staff-mode .customer-search-panel-compact .customer-filter-bar { gap: 7px; }
.staff-mode .customer-search-panel-compact .customer-filter-bar button { min-height: 38px; padding: 0 13px; font-size: .75rem; }
.staff-mode .customer-month-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  margin-bottom: 10px;
  padding: 12px 13px;
  border-color: #cfe3f1;
  border-radius: 18px;
  background: linear-gradient(145deg, #eef8ff, #fff);
}

.staff-mode .customer-month-compact input { grid-column: 2; grid-row: 1; width: 148px; height: 46px; font-size: .85rem; }
.staff-mode .customer-month-compact > div { grid-column: 1; grid-row: 1; gap: 5px; }
.staff-mode .customer-month-label {
  color: var(--employee-blue);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .09em;
}
.staff-mode .customer-month-compact strong {
  overflow: visible;
  color: var(--employee-blue-dark);
  font-size: .86rem;
  line-height: 1.4;
  text-overflow: clip;
  white-space: normal;
}

.staff-mode .customer-month-compact small { overflow: visible; font-size: .75rem; text-overflow: clip; white-space: normal; }
.staff-mode .compact-customer-card { border-radius: 18px; box-shadow: var(--employee-shadow); }
.staff-mode .customer-compact-summary { grid-template-columns: 42px minmax(0, 1fr) 32px; min-height: 68px; padding: 10px 12px; }
.staff-mode .customer-compact-summary .avatar { width: 42px; height: 42px; border-radius: 13px; }
.staff-mode .customer-compact-summary > strong { font-size: .94rem; }
.staff-mode .compact-customer-details { gap: 10px; padding: 12px; }
.staff-mode .compact-contact { font-size: .82rem; }
.staff-mode .compact-contact small { font-size: .76rem; }
.staff-mode .compact-actions .customer-action { min-height: 44px; font-size: .78rem; }
.staff-mode .customer-volume-stat { padding: 11px 12px; font-size: .76rem; }
.staff-mode .customer-volume-stat strong { font-size: .82rem; line-height: 1.4; }
.staff-mode .customer-business-row > span,
.staff-mode .compact-account-row > span { padding: 10px; font-size: .75rem; }
.staff-mode .customer-business-row strong,
.staff-mode .compact-account-row strong { font-size: .8rem; line-height: 1.35; }
.staff-mode .customer-insight-card-actions .btn { min-height: 44px; font-size: .78rem; }
.staff-mode .compact-detail-link { min-height: 42px; font-size: .78rem; }

/* Biểu mẫu nhân viên như một bottom sheet, giữ nút lưu trong tầm tay. */
.staff-mode dialog { border-radius: 24px; }
.staff-mode dialog form { gap: 14px; }
.staff-mode .dialog-head small { font-size: .75rem; }
.staff-mode .dialog-head h2 { font-size: 1.45rem; line-height: 1.2; }
.staff-mode .icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; }
.staff-mode dialog label { font-size: .85rem; line-height: 1.35; }
.staff-mode dialog input,
.staff-mode dialog select { min-height: 50px; font-size: 1rem; }
.staff-mode dialog .helper-note,
.staff-mode dialog .field-hint,
.staff-mode dialog .field-hint-inline { font-size: .75rem; line-height: 1.45; }
.staff-mode dialog .check-row { min-height: 54px; font-size: .88rem; }
.staff-mode dialog .dialog-actions .btn { min-height: 52px; font-size: .9rem; }

.staff-mode .delivery-customer-picker-compact .delivery-customer-search-box {
  height: 50px;
  border-radius: 14px;
}

.staff-mode .delivery-customer-picker-compact .delivery-customer-search-box input {
  height: 48px;
  font-size: 1rem;
}

.staff-mode .delivery-customer-picker-compact .delivery-customer-results {
  max-height: 310px;
  gap: 6px;
  padding: 7px;
  border-radius: 15px;
}

.staff-mode .delivery-customer-result.compact {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 58px;
  gap: 9px;
  padding: 8px 9px;
}

.staff-mode .delivery-customer-result.compact .avatar { width: 40px; height: 40px; }
.staff-mode .delivery-result-name strong { font-size: .88rem; }
.staff-mode .delivery-result-name small { font-size: .75rem; }
.staff-mode .delivery-customer-result.compact > b { font-size: .75rem; }
.staff-mode .delivery-customer-picker-compact .delivery-customer-selected { min-height: 60px; padding: 9px 10px; }
.staff-mode .delivery-selected-main .avatar { width: 40px; height: 40px; }
.staff-mode .delivery-selected-main strong { font-size: .9rem; }
.staff-mode .delivery-selected-main small { font-size: .75rem; }
.staff-mode .delivery-change-customer { min-width: 64px; height: 40px; font-size: .75rem; }

/* Hồ sơ 360° vẫn đầy đủ trên tài khoản nhân viên nhưng được trình bày dễ đọc. */
.staff-mode .customer-insight-shell { gap: 14px; }
.staff-mode .customer-insight-toolbar { gap: 10px; }
.staff-mode .customer-insight-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
.staff-mode .customer-insight-kpis article {
  min-height: 88px;
  border-radius: 14px;
  padding: 11px;
}

.staff-mode .customer-insight-kpis small { font-size: .75rem; line-height: 1.3; }
.staff-mode .customer-insight-kpis strong { margin-top: 7px; font-size: .94rem; line-height: 1.3; }
.staff-mode .customer-insight-section { padding: 12px; }
.staff-mode .customer-insight-section .section-head small { font-size: .75rem; }
.staff-mode .customer-insight-section .section-head h2 { font-size: 1rem; }
.staff-mode .customer-monthly-bars span { font-size: .75rem; }
.staff-mode .customer-month-table { min-width: 600px; font-size: .75rem; }
.staff-mode .customer-month-table th,
.staff-mode .customer-month-table td { padding: 10px 8px; }
.staff-mode .customer-insight-deliveries > div { min-height: 58px; align-items: center; }
.staff-mode .customer-insight-deliveries small { font-size: .75rem; line-height: 1.35; }
.staff-mode .customer-insight-actions .btn { min-height: 50px; font-size: .85rem; }

.staff-mode .empty {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  border-color: #c6dce9;
  border-radius: 20px;
  padding: 28px 18px;
  color: #697f92;
  font-size: .9rem;
  line-height: 1.5;
}

.staff-mode footer { margin-top: 24px; }
.staff-mode footer button,
.staff-mode footer .app-version { min-height: 40px; font-size: .75rem; }

@media (max-width: 700px) {
  .staff-mode .shell { padding-left: 12px; padding-right: 12px; }
  .staff-mode .tabs { margin-left: -12px; margin-right: -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .staff-mode dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
  }
  .staff-mode dialog form { padding: 18px 16px max(14px, env(safe-area-inset-bottom)); }
  .staff-mode dialog .dialog-head { position: sticky; z-index: 5; top: -18px; margin: -18px -16px 0; background: #fff; padding: 17px 16px 13px; }
}

@media (max-width: 430px) {
  .staff-mode .header { gap: 9px; }
  .staff-mode .brand { gap: 9px; }
  .staff-mode .logo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 15px; }
  .staff-mode .brand h1 { font-size: 1.15rem; }
  .staff-mode .brand small { font-size: .75rem; }
  .staff-mode .account-button { min-width: 98px; max-width: 108px; min-height: 48px; padding: 6px 9px; }
  .staff-mode .account-button span { max-width: 88px; font-size: .82rem; }
  .staff-mode .account-button small { font-size: .75rem; }
  .staff-mode .tabs .tab { min-height: 47px; padding: 0 3px; font-size: .78rem; }
  .staff-mode #overview > .toolbar { grid-template-columns: minmax(0, 1fr) 135px; padding: 10px 11px; }
  .staff-mode #overview > .toolbar input { width: 135px; }
  .staff-command { grid-template-columns: 36px minmax(0, 1fr); min-height: 62px; gap: 8px; padding: 8px 9px; }
  .staff-command-icon { width: 36px; height: 36px; }
  .staff-command strong { font-size: .87rem; }
  .staff-command small { font-size: .75rem; }
  .staff-mode .staff-workflow { padding: 12px; border-radius: 19px; }
  .staff-mode .staff-shift-hero { min-height: 120px; padding: 16px; }
  .staff-mode .staff-shift-hero strong { font-size: 1.9rem; }
  .staff-mode .staff-shift-status { padding: 7px 8px; }
  .staff-mode .delivery-page-head { padding: 11px 12px; }
  .staff-mode .delivery-create-button { min-width: 116px; padding: 0 11px; }
  .employee-search-panel { gap: 7px; padding: 8px; }
  .employee-search-count { min-width: 62px; padding: 8px; font-size: .7rem; }
  .staff-mode .customer-month-compact { grid-template-columns: minmax(0, 1fr) 132px; padding: 11px; }
  .staff-mode .customer-month-compact input { width: 132px; }
}

@media (max-width: 370px) {
  .staff-mode .brand h1 { font-size: 1.02rem; }
  .staff-mode .account-button { min-width: 91px; max-width: 96px; }
  .staff-mode .account-button span { max-width: 76px; }
  .staff-mode .tabs .tab { font-size: .75rem; }
  .staff-mode #overview > .toolbar { grid-template-columns: 1fr; }
  .staff-mode #overview > .toolbar input { width: 100%; }
  .staff-command-bar { grid-template-columns: 1fr; }
  .staff-command { min-height: 60px; }
  .staff-mode .staff-shift-hero { display: grid; gap: 10px; }
  .staff-mode .staff-shift-status { justify-self: start; }
  .staff-mode .staff-money-primary { grid-template-columns: 1fr; }
  .staff-money-primary article:last-child { grid-column: auto; }
  .staff-mode .staff-shift-readiness { grid-template-columns: 1fr; }
  .staff-mode .staff-shift-checks { justify-items: start; }
  .staff-mode .delivery-page-head { grid-template-columns: 1fr; }
  .staff-mode .delivery-create-button { width: 100%; }
  .employee-search-panel { grid-template-columns: 1fr; }
  .employee-search-count { justify-self: start; }
  .staff-mode .debt-hero { grid-template-columns: 1fr; }
  .staff-mode .debt-hero .btn { width: 100%; }
  .staff-mode .customer-month-compact { grid-template-columns: 1fr; }
  .staff-mode .customer-month-compact input,
  .staff-mode .customer-month-compact > div { grid-column: 1; grid-row: auto; width: 100%; }
  .staff-mode #delivery-list .entry-values { grid-template-columns: 1fr; }
  .staff-mode #delivery-list .entry-values .products { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .employee-search-box,
  .staff-command { transition: none; }
}


/* 3.24.0 — Nhân viên tự nạp hàng trong ca */
.staff-mode .staff-command-bar{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.staff-mode #staff-vehicle-load-open{
  border-color:#bedcf6;
  background:linear-gradient(145deg,#f2f9ff,#fff);
}
.staff-mode #staff-vehicle-load-open .staff-command-icon{
  background:#e7f3ff;color:#0878ef;
}
.staff-mode #vehicle-stock-dialog .vehicle-auto-confirm-note{
  background:#eefaf4;border-color:#b9e6d2;
}
.staff-mode #vehicle-stock-dialog #vehicle-stock-employee-field{display:none!important}
.staff-mode #vehicle-stock-dialog .dialog-actions .primary{background:#0878ef}
@media(max-width:560px){
  .staff-mode .staff-command-bar{grid-template-columns:1fr 1fr;gap:8px}
  .staff-mode .staff-command{min-height:58px}
}
