:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e0e7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --danger: #b42318;
  --soft: #eef8f6;
  --shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px;
  background: #10202f;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 4px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f7c948;
  color: #10202f;
  font-weight: 800;
}

.brand-mark-logo {
  overflow: hidden;
  background: #fff;
}

.brand-mark-logo img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 4px;
  color: #a8b3c2;
  font-size: 12px;
}

.sync-chip {
  align-self: end;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0f5f55;
  background: #e8f7f2;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-chip[data-state="loading"],
.sync-chip[data-state="saving"] {
  color: #8a4b08;
  background: #fff4d6;
}

.sync-chip[data-state="local"],
.sync-chip[data-state="error"] {
  color: #9a3412;
  background: #fff1ed;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: #d8e1ea;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, .13);
}

.nav-item:disabled {
  color: #778596;
  cursor: not-allowed;
}

.nav-submenu {
  display: grid;
  gap: 4px;
  margin: -2px 0 8px;
  padding-left: 12px;
}

.nav-subitem {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: #a8b3c2;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.nav-subitem.active {
  color: #fff;
  border-left-color: #f7c948;
  background: rgba(255, 255, 255, .09);
}

.main-area {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.topbar p,
.section-head p,
.modal-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.account-chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.account-chip span,
.account-chip strong {
  display: block;
}

.account-chip span {
  color: var(--muted);
  font-size: 12px;
}

.identity-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 12px;
  align-items: center;
}

.identity-switch label {
  display: grid;
  grid-template-rows: 16px 32px;
  align-items: center;
  min-width: 96px;
}

.identity-switch .manager-select-wrap[hidden] {
  display: none;
}

.current-employee-wrap {
  min-width: 110px;
}

.current-employee-wrap strong {
  margin-top: 0;
  font-size: 14px;
}

.identity-switch select {
  min-height: 32px;
  margin-top: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font-weight: 800;
}

.logout-btn {
  align-self: end;
  min-height: 32px;
  padding: 0 10px;
}

.password-btn {
  align-self: end;
  min-height: 32px;
  padding: 0 10px;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .55);
}

.login-backdrop[hidden] {
  display: none;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-brand-logo {
  display: grid;
  gap: 12px;
  align-items: start;
}

.login-logo {
  display: block;
  width: min(360px, 100%);
  height: auto;
  object-fit: contain;
}

.login-brand p,
.login-tip {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form button {
  justify-self: start;
}

.login-captcha-field {
  gap: 8px;
}

.login-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
}

.login-captcha-row .secondary-btn {
  min-height: 38px;
  justify-content: center;
}

.login-captcha-image {
  width: 118px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

body.login-open {
  overflow: hidden;
}

.customer-subnav {
  display: flex;
  gap: 8px;
  max-width: 1440px;
  margin: 0 auto 14px;
  border-bottom: 1px solid var(--line);
}

.subnav-item {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #475467;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.subnav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.metrics,
.workspace {
  max-width: 1440px;
  margin: 0 auto 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metrics article,
.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.metrics article {
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.workspace {
  padding: 18px;
}

.customer-section {
  display: none;
}

.customer-section.active {
  display: block;
}

.dashboard-workspace {
  margin-top: 0;
}

.finance-panel {
  display: none;
}

.finance-panel.active {
  display: block;
}

.procurement-panel {
  display: none;
}

.procurement-panel.active {
  display: block;
}

.team-panel {
  display: none;
}

.team-panel.active {
  display: block;
}

.executive-panel {
  display: none;
}

.executive-panel.active {
  display: block;
}

.finance-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.procurement-panel .finance-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.executive-overview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-metrics article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.finance-metrics span {
  color: var(--muted);
  font-size: 13px;
}

.finance-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.dashboard-grid,
.collection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.executive-grid,
.executive-section > .dashboard-grid {
  margin-bottom: 14px;
  align-items: stretch;
}

.executive-single-board {
  margin-top: 14px;
}

.finance-payment-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.settings-editor,
.table-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.procurement-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

.procurement-dashboard-mini,
.procurement-line-board {
  margin-bottom: 14px;
}

.procurement-dashboard-mini .finance-metrics {
  margin-bottom: 0;
}

.dashboard-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-exception-panel {
  grid-column: 1 / -1;
}

.finance-exception-panel {
  margin-top: 14px;
}

.finance-panel[data-finance-panel="dashboard"].active {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.finance-panel[data-finance-panel="dashboard"] > .section-head,
.finance-panel[data-finance-panel="dashboard"] > .finance-metrics {
  grid-column: 1 / -1;
}

.finance-panel[data-finance-panel="dashboard"] > .dashboard-grid {
  display: contents;
}

.finance-panel[data-finance-panel="dashboard"] .finance-exception-panel {
  margin-top: 0;
}

.finance-panel[data-finance-panel="dashboard"] .finance-metrics {
  gap: 8px;
  margin-bottom: 0;
}

.finance-panel[data-finance-panel="dashboard"] .finance-metrics article,
.finance-panel[data-finance-panel="dashboard"] .dashboard-panel {
  padding: 12px;
}

.finance-panel[data-finance-panel="dashboard"] .finance-metrics strong {
  margin-top: 4px;
  font-size: 22px;
}

.finance-panel[data-finance-panel="dashboard"] .dashboard-list {
  gap: 8px;
}

.finance-panel[data-finance-panel="dashboard"] .dashboard-row,
.finance-panel[data-finance-panel="dashboard"] .empty-state {
  padding: 10px;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fbfcfd;
}

.dashboard-row strong,
.dashboard-row span {
  display: block;
}

.dashboard-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.converted-opportunity-row {
  align-items: flex-start;
}

.converted-opportunity-row > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.converted-opportunity-row strong,
.converted-opportunity-row span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.converted-opportunity-row .row-actions {
  flex: 0 0 auto;
  align-self: flex-start;
}

.fulfillment-status-line {
  line-height: 1.5;
}

.finance-exception-row {
  align-items: flex-start;
}

.finance-exception-row > div:first-child {
  min-width: 0;
}

.finance-exception-row > div:first-child span {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.readonly-banner {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 13px;
  font-weight: 600;
}

.handover-preview .dashboard-row {
  align-items: flex-start;
}

.handover-summary {
  background: #f7fbfa;
}

.handover-record-panel {
  margin-top: 14px;
}

.handover-record-row {
  align-items: flex-start;
}

.handover-record-status {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.section-head,
.toolbar,
.modal-head,
.modal-actions,
.panel-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
}

.section-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.compact-field {
  display: grid;
  gap: 4px;
  min-width: 126px;
}

.compact-field span {
  color: var(--muted);
  font-size: 12px;
}

.compact-field select,
.compact-field input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.custom-conversion-field {
  min-width: 82px;
}

.toolbar {
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 16px 0;
}

.search-field {
  flex: 1;
  max-width: 520px;
}

.filter-field {
  flex: 0 0 150px;
}

.ledger-toolbar .filter-field {
  flex-basis: 150px;
}

.ledger-toolbar .ledger-account-filter {
  flex-basis: 280px;
}

.filter-field select {
  min-height: 40px;
}

.cell-stack {
  display: grid;
  gap: 3px;
}

.cell-stack strong,
.cell-stack span {
  display: block;
}

.cell-stack span {
  color: var(--muted);
  font-size: 12px;
}

label span,
.search-field span {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

b {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input[readonly] {
  color: #475467;
  background: #f8fafc;
}

small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.table-action {
  border-radius: 6px;
  cursor: pointer;
}

.primary-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  border-color: #a7b1bd;
  background: #a7b1bd;
  cursor: not-allowed;
}

.ghost-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: #344054;
  background: #fff;
}

.danger-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #f0b4ad;
  color: var(--danger);
  background: #fff7f6;
  font-weight: 700;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #b7d4ce;
  color: #0f5f55;
  background: #f1fbf9;
  font-size: 13px;
  font-weight: 700;
}

.table-action:disabled {
  color: #98a2b3;
  border-color: #d0d5dd;
  background: #f2f4f7;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.customer-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.customer-table th:first-child,
.customer-table td:first-child {
  width: 11%;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 9%;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  width: 11%;
}

.customer-table th:nth-child(8),
.customer-table td:nth-child(8) {
  width: 9%;
}

.customer-table th:nth-child(13),
.customer-table td:nth-child(13) {
  width: 8%;
}

.customer-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.customer-table th,
.customer-table td {
  padding: 10px 8px;
}

.follow-table {
  min-width: 980px;
}

.collection-table {
  min-width: 1220px;
}

.record-card-list {
  display: grid;
  gap: 10px;
}

.record-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.record-card header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-card header div {
  min-width: 0;
}

.record-card header strong,
.record-card header span {
  display: block;
}

.record-card header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.record-card-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 13px;
}

.record-card-grid span {
  color: var(--muted);
}

.record-card-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.detail-head-actions,
.pool-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.customer-pool-toolbar {
  margin-top: 0;
}

.customer-pool-list {
  display: grid;
  gap: 12px;
}

.customer-pool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #cfe1de;
  border-left: 4px solid #0f8279;
  border-radius: 8px;
  background: #f7fbfa;
}

.pool-card-main,
.pool-card-heading > div {
  min-width: 0;
}

.pool-card-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.pool-card-heading strong,
.pool-card-heading span {
  display: block;
}

.pool-card-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pool-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 14px;
}

.pool-card-grid div {
  min-width: 0;
}

.pool-card-grid span,
.pool-need span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.pool-card-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.pool-need,
.pool-release-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff;
}

.pool-need p {
  margin: 0;
  line-height: 1.55;
}

.pool-release-note {
  color: #5f6b75;
  font-size: 13px;
}

.pool-import-modal {
  width: min(940px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
}

.pool-import-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.pool-import-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #cfe1de;
  border-radius: 7px;
  background: #f5fbfa;
}

.pool-import-guide strong,
.pool-import-guide span {
  display: block;
}

.pool-import-guide span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pool-import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pool-import-summary div {
  padding: 10px 12px;
  border: 1px solid #d8e1e8;
  border-radius: 7px;
  background: #fff;
}

.pool-import-summary span,
.pool-import-summary strong {
  display: block;
  overflow-wrap: anywhere;
}

.pool-import-summary span {
  color: var(--muted);
  font-size: 12px;
}

.pool-import-summary strong {
  margin-top: 3px;
  font-size: 16px;
}

.pool-import-preview {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
}

.pool-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #d8e1e8;
  border-left: 4px solid #0f8279;
  border-radius: 7px;
  background: #f8fbfb;
}

.pool-import-row.invalid {
  border-left-color: #d7594d;
  background: #fff8f7;
}

.pool-import-row strong,
.pool-import-row span {
  display: block;
  overflow-wrap: anywhere;
}

.pool-import-row > div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.success-state {
  border-color: #b7dfd7;
  background: #eefaf7;
  color: #0b6d64;
}

.compact-modal {
  width: min(620px, calc(100vw - 32px));
}

.modal-form {
  padding: 18px;
}

.payment-table {
  min-width: 0;
  table-layout: fixed;
}

.compact-table,
.account-ledger-table {
  min-width: 0;
  table-layout: fixed;
}

.compact-table td,
.account-ledger-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  vertical-align: top;
}

.team-panel .table-wrap {
  overflow-x: hidden;
}

.team-panel table {
  min-width: 0;
  table-layout: fixed;
}

.team-panel th,
.team-panel td {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.team-panel .compact-table {
  font-size: 13px;
}

.audit-log-table th:first-child,
.audit-log-table td:first-child {
  width: 12%;
}

.audit-log-table th:nth-child(2),
.audit-log-table td:nth-child(2) {
  width: 14%;
}

.audit-log-table th:nth-child(3),
.audit-log-table td:nth-child(3),
.audit-log-table th:nth-child(4),
.audit-log-table td:nth-child(4) {
  width: 12%;
}

.audit-log-table th:nth-child(5),
.audit-log-table td:nth-child(5) {
  width: 20%;
}

.account-ledger-table th:first-child,
.account-ledger-table td:first-child {
  width: 12%;
}

.account-ledger-table th:nth-child(2),
.account-ledger-table td:nth-child(2) {
  width: 26%;
}

.account-ledger-table th:nth-child(3),
.account-ledger-table td:nth-child(3) {
  width: 10%;
}

.account-ledger-table th:nth-child(4),
.account-ledger-table td:nth-child(4) {
  width: 12%;
}

.account-ledger-table th:nth-child(5),
.account-ledger-table td:nth-child(5) {
  width: 16%;
}

.account-ledger-table th:nth-child(6),
.account-ledger-table td:nth-child(6) {
  width: 24%;
}

.procurement-table {
  min-width: 0;
  table-layout: fixed;
}

.procurement-list-toolbar {
  margin: 12px 0;
}

.procurement-list-toolbar .search-field {
  max-width: 680px;
}

.procurement-table th:first-child,
.procurement-table td:first-child {
  width: 22%;
}

.procurement-table th:nth-child(2),
.procurement-table td:nth-child(2) {
  width: 22%;
}

.procurement-table th:nth-child(3),
.procurement-table td:nth-child(3),
.procurement-table th:nth-child(4),
.procurement-table td:nth-child(4) {
  width: 15%;
}

.procurement-table th:nth-child(6),
.procurement-table td:nth-child(6) {
  width: 8%;
}

.procurement-table td {
  overflow-wrap: anywhere;
  vertical-align: top;
}

.procurement-table tbody tr[data-action="edit-procurement-order"] {
  cursor: pointer;
}

.procurement-table tbody tr[data-action="edit-procurement-order"]:hover td {
  background: #f8fbfd;
}

.procurement-table tbody tr.procurement-completed-row td {
  background: #f1faf6;
}

.procurement-table tbody tr.procurement-completed-row:hover td {
  background: #e8f7f2;
}

.procurement-order-status {
  display: block;
  margin-top: 5px;
}

.procurement-order-status .status-pill {
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.procurement-order-status .status-pill.danger {
  color: #b42318;
  border-color: #f2a39c;
  background: #fff0ee;
}

.procurement-order-status .status-pill.done {
  color: #067647;
  border-color: #86d3b4;
  background: #e8f7f0;
}

.finance-approval-table {
  min-width: 0;
  table-layout: fixed;
}

.finance-approval-table td,
.payment-table td {
  overflow-wrap: anywhere;
}

.finance-approval-table th:first-child,
.finance-approval-table td:first-child {
  width: 11%;
}

.finance-approval-table th:nth-child(2),
.finance-approval-table td:nth-child(2) {
  width: 11%;
}

.finance-approval-table th:nth-child(3),
.finance-approval-table td:nth-child(3) {
  width: 8%;
}

.finance-approval-table th:nth-child(4),
.finance-approval-table td:nth-child(4) {
  width: 12%;
}

.finance-approval-table th:nth-child(5),
.finance-approval-table td:nth-child(5) {
  width: 10%;
}

.finance-approval-table th:nth-child(6),
.finance-approval-table td:nth-child(6) {
  width: 10%;
}

.finance-approval-table th:nth-child(7),
.finance-approval-table td:nth-child(7) {
  width: 14%;
}

.finance-approval-table th:nth-child(8),
.finance-approval-table td:nth-child(8) {
  width: 8%;
}

.finance-approval-table th:nth-child(9),
.finance-approval-table td:nth-child(9) {
  width: 8%;
}

.finance-approval-table th:nth-child(10),
.finance-approval-table td:nth-child(10) {
  width: 8%;
}

.account-table {
  width: calc(100% - 12px);
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.account-table th,
.account-table td {
  box-sizing: border-box;
}

.promotion-table {
  min-width: 0;
  table-layout: fixed;
}

.collection-table td {
  overflow-wrap: anywhere;
}

.account-table td {
  overflow-wrap: anywhere;
}

.promotion-table td {
  overflow-wrap: anywhere;
}

.account-table tbody tr[data-action="edit-payment-account"],
.promotion-table tbody tr[data-action="edit-promotion-channel"] {
  cursor: pointer;
}

.account-table tbody tr[data-action="edit-payment-account"]:hover td,
.promotion-table tbody tr[data-action="edit-promotion-channel"]:hover td {
  background: #f8fbfd;
}

.selected-row td {
  background: #eef8f6;
}

.promotion-table th:first-child,
.promotion-table td:first-child {
  width: 46%;
}

.promotion-table th:nth-child(2),
.promotion-table td:nth-child(2) {
  width: 18%;
}

.promotion-table th:nth-child(3),
.promotion-table td:nth-child(3) {
  width: 16%;
}

.promotion-table th:nth-child(4),
.promotion-table td:nth-child(4) {
  width: 20%;
}

.account-table th:first-child,
.account-table td:first-child {
  width: 30%;
}

.account-table th:nth-child(2),
.account-table td:nth-child(2) {
  width: 10%;
}

.account-table th:nth-child(3),
.account-table td:nth-child(3) {
  width: 14%;
}

.account-table th:nth-child(4),
.account-table td:nth-child(4) {
  width: 18%;
}

.account-table th:nth-child(5),
.account-table td:nth-child(5) {
  width: 10%;
}

.account-table th:nth-child(6),
.account-table td:nth-child(6) {
  width: 18%;
}

.table-actions-cell {
  text-align: right;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.row-actions .table-action {
  min-width: 42px;
  padding: 0 6px;
}

.row-actions .danger-action {
  margin-left: 0;
}

.list-title,
.list-meta {
  display: block;
}

.list-title {
  font-weight: 800;
}

.list-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.usage-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  color: #184e77;
  background: #edf6ff;
  font-size: 12px;
  font-weight: 700;
}

.danger-action {
  margin-left: 6px;
  color: var(--danger);
  border-color: #f0b4ad;
  background: #fff7f6;
}

.status-toggle {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  padding: 5px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.status-toggle input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  cursor: pointer;
}

.status-toggle:has(input:checked) {
  color: #8a4b08;
  border-color: #f4c56f;
  background: #fff8e6;
}

.status-toggle.disabled {
  color: #98a2b3;
  background: #f2f4f7;
  cursor: not-allowed;
}

.status-toggle.disabled input {
  cursor: not-allowed;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #475467;
  background: #f8fafc;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: #155e52;
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.info {
  color: #184e77;
  background: #edf6ff;
}

.status-pill.warn {
  color: #8a4b08;
  background: #fff4d6;
}

.status-pill.ok,
.status-pill.done {
  color: #155e52;
  background: #e8f7f2;
}

.status-pill.project {
  color: #7a3b09;
  background: #fff0df;
}

.status-pill.danger {
  color: #9a3412;
  background: #fff1ed;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.todo-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.todo-card strong,
.todo-card span {
  display: block;
}

.todo-card span {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 14px;
  border: 1px dashed #cbd5df;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
}

.task-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  color: #8a4b08;
  background: #fff4d6;
  font-size: 12px;
  font-weight: 700;
}

.save-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #a7e3d5;
  border-radius: 8px;
  color: #0f5f55;
  background: #eefbf7;
  font-size: 13px;
  font-weight: 700;
}

.save-notice.error {
  border-color: #f0b5af;
  color: #9a3412;
  background: #fff5f3;
}

.save-notice.success {
  border-color: #9fd9cb;
  color: #0b6d64;
  background: #eaf8f4;
}

.project-fields {
  padding: 12px;
  border: 1px solid #d6e3ef;
  border-radius: 8px;
  background: #f8fbfd;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.duplicate-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #475467;
  background: #fff;
  font-size: 13px;
}

.duplicate-hint.ok {
  color: #0f5f55;
  border-color: #a7e3d5;
  background: #eefbf7;
}

.duplicate-hint.danger {
  color: #9a3412;
  border-color: #fdba74;
  background: #fff7ed;
}

.project-check-toolbar {
  align-items: end;
  margin-top: 0;
}

.project-check-count {
  margin-top: 4px;
}

.project-check-results {
  display: grid;
  gap: 10px;
}

.project-result {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(300px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fbfcfd;
}

.project-result strong,
.project-result span,
.project-result-meta span {
  display: block;
}

.project-result span,
.project-result-meta span {
  color: var(--muted);
  font-size: 13px;
}

.project-result-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.project-contact {
  justify-self: end;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(920px, 100%);
  max-height: 80vh;
  overflow: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-modal {
  width: min(1180px, 100%);
}

.approval-modal {
  width: min(860px, 100%);
}

.password-modal {
  width: min(520px, 100%);
}

.procurement-edit-modal {
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid #cbd8dd;
  background: #f6faf9;
  box-shadow: 0 22px 56px rgba(16, 32, 47, .2);
}

.procurement-edit-modal .modal-head {
  padding: 14px 18px;
  border-top: 4px solid #f4c542;
  border-bottom-color: #ead99d;
  background: #fff9e7;
  box-shadow: inset 6px 0 0 #16a6a0;
}

.procurement-edit-modal .modal-head h3 {
  color: #173044;
}

.procurement-edit-modal .modal-head span {
  color: #65727e;
}

.procurement-edit-modal .procurement-editor-layout {
  display: block;
  min-height: 0;
  margin-top: 0;
  padding: 16px 18px 0;
  overflow: hidden;
}

.procurement-edit-modal .procurement-editor-layout[hidden] {
  display: none;
}

.procurement-editor-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.procurement-edit-modal .procurement-form {
  max-height: calc(100vh - 144px);
  overflow: auto;
  padding: 2px 7px 0 2px;
  scrollbar-color: #86aaa7 #e8f0ef;
  scrollbar-width: thin;
}

.procurement-edit-modal .procurement-form::-webkit-scrollbar {
  width: 8px;
}

.procurement-edit-modal .procurement-form::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #e8f0ef;
}

.procurement-edit-modal .procurement-form::-webkit-scrollbar-thumb {
  border: 2px solid #e8f0ef;
  border-radius: 999px;
  background: #86aaa7;
}

.procurement-edit-modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -7px 0 -2px;
  padding: 12px 12px 10px;
  border-top: 1px solid #ecdca5;
  background: #fff9e7;
}

.password-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.password-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.approval-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.approval-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.approval-flow-card {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.approval-flow-card.is-pending {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.approval-flow-card.is-return-only {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.approval-flow-card span,
.approval-flow-card strong,
.approval-flow-card small {
  display: block;
}

.approval-flow-card span {
  color: var(--muted);
  font-size: 12px;
}

.approval-flow-card strong {
  margin-top: 4px;
  color: #9a3412;
  font-size: 18px;
}

.approval-flow-card.is-pending strong {
  color: #1d4ed8;
}

.approval-flow-card.is-return-only strong {
  color: #047857;
}

.approval-flow-card small {
  margin-top: 4px;
  color: #7c2d12;
}

.approval-flow-card.is-pending small {
  color: #1e40af;
}

.approval-flow-card.is-return-only small {
  color: #166534;
}

.approval-procurement-decision-field.error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.approval-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.approval-item span,
.approval-item strong {
  display: block;
}

.approval-item span {
  color: var(--muted);
  font-size: 12px;
}

.approval-item strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.approval-actions {
  justify-content: space-between;
}

.approval-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}

.form-grid,
.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid {
  padding: 18px;
}

.full-span {
  grid-column: 1 / -1;
}

.field-group > span {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.checkbox-field {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checkbox-field legend {
  padding: 0 4px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.checkbox-grid label {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

.checkbox-grid input {
  width: auto;
}

.procurement-form {
  display: block;
}

.procurement-master,
.procurement-total-grid,
.procurement-line-head,
.procurement-line {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9e3e7;
  border-radius: 8px;
  background: #fbfcfd;
}

.procurement-edit-modal .procurement-master {
  padding-left: 16px;
  border-color: #cddfe8;
  border-left: 4px solid #15a5b2;
  background: #f1f8fc;
}

.procurement-completion-bar {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.4fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #eadca7;
  border-left: 4px solid #f4c542;
  border-radius: 8px;
  background: #fff9e7;
}

.procurement-completion-state {
  display: grid;
  gap: 5px;
  align-content: center;
}

.procurement-completion-state > span,
.procurement-completion-state small {
  color: var(--muted);
  font-size: 12px;
}

.procurement-completion-state strong {
  width: fit-content;
}

.procurement-completion-reason {
  display: grid;
  gap: 6px;
}

.procurement-completion-reason > span {
  font-size: 13px;
  font-weight: 800;
}

.procurement-completion-bar > button {
  min-width: 96px;
}

.procurement-master strong,
.procurement-master span,
.procurement-line-head strong,
.procurement-line-head span {
  display: block;
}

.procurement-master span,
.procurement-line-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.procurement-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.procurement-total-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #cfe8e3;
  border-radius: 8px;
  background: #edf9f6;
}

.procurement-total-grid div:nth-child(2) {
  border-color: #eadca7;
  background: #fff8df;
}

.procurement-total-grid div:nth-child(3) {
  border-color: #ecd8df;
  background: #fff3f7;
}

.procurement-total-grid div:nth-child(4) {
  border-color: #d3e1ee;
  background: #f1f7fd;
}

.procurement-total-grid span,
.procurement-total-grid strong {
  display: block;
}

.procurement-total-grid span {
  color: var(--muted);
  font-size: 12px;
}

.procurement-total-grid strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.procurement-line-head,
.procurement-line-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.procurement-edit-modal .procurement-line-head {
  padding-left: 16px;
  border-color: #eadca7;
  border-left: 4px solid #f4c542;
  background: #fff9e7;
}

.procurement-line-title {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.procurement-lines {
  display: grid;
  gap: 14px;
}

.procurement-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border-color: #d7e3e7;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 32, 47, .045);
}

.procurement-line:nth-child(even) {
  border-color: #d6e3ed;
  background: #f6faff;
}

.procurement-line-title strong {
  position: relative;
  padding-left: 12px;
  color: #173044;
}

.procurement-line-title strong::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: #f4c542;
  content: "";
}

.procurement-line-focus {
  border-color: #16a69e;
  background: #edf9f6;
  box-shadow: 0 0 0 2px rgba(22, 166, 158, .14), 0 8px 22px rgba(16, 32, 47, .07);
}

.procurement-line-focus .procurement-line-title strong::before {
  background: #db3f78;
}

.procurement-edit-modal .procurement-line input,
.procurement-edit-modal .procurement-line select,
.procurement-edit-modal .procurement-line textarea {
  background: rgba(255, 255, 255, .96);
}

.procurement-line-remark {
  grid-column: 1 / -1;
}

@media (max-width: 820px) {
  .procurement-completion-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  font-size: 13px;
  font-weight: 700;
}

.check-grid input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.forbidden {
  padding: 12px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  color: #7a4504;
  background: #fffbeb;
  font-size: 13px;
}

.forbidden strong {
  display: block;
  margin-bottom: 4px;
}

.detail-body {
  padding: 18px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.need-card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #c7e2dc;
  border-radius: 8px;
  background: #f2fbf8;
}

.need-card .panel-head {
  margin-bottom: 8px;
}

.need-card p {
  color: #173f37;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-exception-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #c7e2dc;
}

.lead-exception-list {
  display: grid;
  gap: 8px;
}

.lead-exception-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #d8eee8;
  border-radius: 8px;
  background: #fff;
}

.lead-exception-row strong,
.lead-exception-row span {
  display: block;
}

.lead-exception-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.compact-empty {
  padding: 10px 12px;
}

.detail-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #475467;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab-panel {
  display: none;
}

.detail-tab-panel.active {
  display: block;
}

.summary-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.summary-item span,
.summary-item strong {
  display: block;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.detail-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profile-wide-panel {
  max-width: 760px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.todo-list,
.follow-list {
  display: grid;
  gap: 10px;
}

.todo-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fbfcfd;
}

.todo-row strong,
.todo-row span {
  display: block;
}

.todo-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.todo-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}

.follow-item {
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fbfcfd;
}

.follow-item strong,
.follow-item span {
  display: block;
}

.follow-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.follow-item p {
  margin-top: 10px;
  color: #344054;
  line-height: 1.6;
  white-space: pre-wrap;
}

.follow-item .follow-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.opportunity-list {
  display: grid;
  gap: 10px;
}

.opportunity-card {
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fbfcfd;
}

.opportunity-card-focus {
  border-color: #9ad7ce;
  background: #f8fffd;
}

.opportunity-card.selected-row {
  border-color: #0f766e;
  background: #f0fdfa;
}

.opportunity-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.opportunity-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.opportunity-card strong,
.opportunity-card span {
  display: block;
}

.opportunity-card span {
  color: var(--muted);
  font-size: 13px;
}

.opportunity-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.opportunity-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.opportunity-detail-grid div,
.opportunity-detail-block {
  padding: 10px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #fff;
}

.opportunity-detail-grid span,
.opportunity-detail-block span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.opportunity-detail-grid strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.opportunity-detail-block {
  margin-top: 10px;
}

.opportunity-detail-block strong {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.sales-fulfillment-block {
  border-color: #b9ddd4;
  background: #f0faf7;
}

.sales-fulfillment-block p {
  margin: 7px 0 0;
  color: #284d49;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
}

.opportunity-card p {
  margin-top: 10px;
  color: #344054;
  line-height: 1.6;
  white-space: pre-wrap;
}

.opportunity-card .next-action {
  color: #0f5f55;
  font-weight: 700;
}

.error input,
.error select,
.error textarea {
  border-color: var(--danger);
}

.field-group.error .check-grid {
  border-color: var(--danger);
}

.checkbox-field.error {
  border-color: var(--danger);
}

.profile-form .modal-actions {
  justify-content: flex-end;
}

.duplicate {
  color: var(--danger);
}

.ok {
  color: var(--accent);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .finance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .procurement-total-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .approval-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .procurement-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .collection-layout,
  .settings-layout,
  .finance-payment-layout {
    grid-template-columns: 1fr;
  }

  .finance-panel[data-finance-panel="dashboard"].active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .customer-pool-card {
    grid-template-columns: 1fr;
  }

  .pool-import-guide,
  .pool-import-row {
    grid-template-columns: 1fr;
  }

  .pool-import-summary {
    grid-template-columns: 1fr;
  }

  .pool-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pool-card-actions {
    justify-content: flex-end;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .metrics,
  .finance-metrics,
  .todo-grid,
  .form-grid,
  .profile-form,
  .checkbox-grid,
  .project-grid,
  .opportunity-meta,
  .opportunity-detail-grid,
  .procurement-total-grid,
  .detail-summary {
    grid-template-columns: 1fr;
  }

  .approval-summary {
    grid-template-columns: 1fr;
  }

  .topbar,
  .identity-switch,
  .section-head,
  .toolbar,
  .modal-head,
  .modal-actions,
  .panel-head,
  .todo-row,
  .project-result,
  .dashboard-row {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-subnav {
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .subnav-item {
    flex: 0 0 auto;
  }

  .search-field {
    max-width: none;
  }

  .full-span {
    grid-column: auto;
  }

  .todo-actions {
    justify-content: space-between;
  }

  .project-result {
    display: flex;
  }

  .project-result-meta {
    grid-template-columns: 1fr;
  }

  .project-contact {
    justify-self: auto;
  }

  .identity-switch {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
}
.mini-selection-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.nav-subitem-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-count-badge {
  min-width: 22px;
  padding: 2px 6px;
  background: #b42318;
  border-radius: 11px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.mini-selection-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.mini-selection-metrics article {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #d8e2e8;
}

.mini-selection-metrics span,
.mini-selection-metrics strong {
  display: block;
}

.mini-selection-metrics span {
  color: #667085;
  font-size: 12px;
}

.mini-selection-metrics strong {
  margin-top: 3px;
  font-size: 24px;
}

.mini-selection-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid #d8e2e8;
  border-radius: 8px;
}

.mini-selection-card-main {
  min-width: 0;
}

.mini-selection-card-head,
.mini-selection-card-meta,
.mini-selection-card-actions,
.mini-quote-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-workflow-panel {
  margin-top: 16px;
  padding: 14px;
  background: #f6faf9;
  border: 1px solid #cfe0dc;
}

.mini-workflow-head,
.mini-workflow-fields,
.mini-workflow-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-workflow-head {
  justify-content: space-between;
}

.mini-workflow-head strong,
.mini-workflow-head span {
  display: block;
}

.mini-workflow-head span {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.mini-workflow-fields {
  margin-top: 12px;
}

.mini-workflow-fields label {
  width: 190px;
}

.mini-workflow-fields label span {
  display: block;
  margin-bottom: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.mini-workflow-fields input,
.mini-workflow-fields select {
  width: 100%;
}

.mini-workflow-fields .mini-contact-note {
  min-width: 280px;
  flex: 1;
}

.mini-workflow-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mini-contact-overdue {
  color: #b42318;
  font-weight: 800;
}

.mini-selection-card-head {
  flex-wrap: wrap;
}

.mini-selection-card-head strong {
  font-size: 16px;
}

.mini-selection-card-head span:not(.status-pill) {
  color: #667085;
  font-size: 13px;
}

.mini-selection-card-meta {
  flex-wrap: wrap;
  margin-top: 10px;
  color: #475467;
  font-size: 13px;
}

.mini-selection-card-meta span {
  padding-right: 12px;
  border-right: 1px solid #d8e2e8;
}

.mini-selection-card-meta span:last-child {
  border-right: 0;
}

.mini-selection-products {
  overflow: hidden;
  margin-top: 10px;
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-selection-card-actions {
  align-self: center;
}

.mini-selection-modal {
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}

.mini-selection-modal-body {
  overflow: auto;
  padding: 20px;
}

.mini-selection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #f6faf9;
  border: 1px solid #d8e2e8;
}

.mini-selection-summary div {
  min-width: 0;
}

.mini-selection-summary span,
.mini-selection-summary strong {
  display: block;
}

.mini-selection-summary span {
  color: #667085;
  font-size: 12px;
}

.mini-selection-summary strong {
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 14px;
}

.mini-quote-controls {
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px;
  background: #fff8e8;
  border-left: 4px solid #d99a00;
}

.mini-quote-controls label {
  width: 220px;
}

.mini-quote-controls label span,
.mini-quote-note span {
  display: block;
  margin-bottom: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.mini-quote-controls input {
  width: 100%;
}

.mini-quote-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid #d8e2e8;
}

.mini-quote-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.mini-quote-table th,
.mini-quote-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e8eef1;
  text-align: left;
  vertical-align: top;
}

.mini-quote-table th {
  background: #f6f8fa;
  color: #475467;
  font-size: 12px;
}

.mini-quote-table td {
  font-size: 13px;
}

.mini-quote-product strong,
.mini-quote-product span {
  display: block;
}

.mini-quote-product span {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.mini-quote-price {
  width: 110px;
}

.mini-quote-total-row td {
  background: #f0faf7;
  font-weight: 700;
}

.mini-quote-note {
  display: block;
  margin-top: 16px;
}

.mini-quote-note textarea {
  width: 100%;
}

@media (max-width: 760px) {
  .mini-selection-card {
    grid-template-columns: 1fr;
  }

  .mini-selection-card-actions {
    justify-content: flex-end;
  }

  .mini-selection-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-quote-controls label {
    width: 100%;
  }

  .mini-selection-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-workflow-fields {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-workflow-fields label,
  .mini-workflow-fields .mini-contact-note {
    width: 100%;
  }
}
.mini-quote-missing {
  color: #b42318;
  font-weight: 800;
}
