:root {
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.owner-target-card { max-width: 52rem; }
.system-message-list { display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.system-message { background: #eaf7ef; border: 1px solid #9dd9b2; border-radius: 0.7rem; color: #17613a; margin: 0; padding: 0.75rem 1rem; }
.system-message.is-error { background: #fff0f0; border-color: #f2aaaa; color: #9b1c1c; }
.owner-target-form { display: grid; gap: 1.25rem; }
.owner-target-month { align-items: end; display: grid; gap: 0.65rem; grid-template-columns: minmax(0, 1fr) auto; }
.owner-target-month label { grid-column: 1 / -1; font-weight: 700; }
.owner-target-list { display: grid; gap: 0.75rem; }
.owner-target-list > label { align-items: center; background: #f7f9fc; border: 1px solid #dfe6f0; border-radius: 0.8rem; display: grid; gap: 0.75rem; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 0.7fr); padding: 0.9rem 1rem; }
.owner-target-list input { margin-left: 0.35rem; width: 100%; }
.money-input-prefix { align-items: center; color: #52637b; display: flex; }

@media (max-width: 640px) {
  .owner-target-month,
  .owner-target-list > label { grid-template-columns: 1fr; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f8fafc;
  overflow-x: hidden;
}

.site-header,
.page-content {
  margin: 0 auto;
  max-width: 720px;
  padding: 1rem;
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.brand {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.header-link { color: #1d4ed8; font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.workspace-home-link { background: #eaf2ff; border: 1px solid #cfe0ff; border-radius: 0.55rem; color: #174ea6; font-weight: 700; padding: 0.48rem 0.68rem; }
.workspace-home-link:hover { background: #dce9ff; }

.header-logout {
  background: #e2e8f0;
  color: #1f2937;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  width: auto;
}

.auth-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgb(15 23 42 / 12%);
  margin: 2rem auto;
  max-width: 420px;
  padding: 1.5rem;
}

.workspace-access-card {
  background: #fff;
  border: 1px solid #dce5e0;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgb(24 48 36 / 8%);
  margin: 4rem auto;
  max-width: 34rem;
  padding: 2.5rem;
  text-align: center;
}
.workspace-access-icon {
  align-items: center;
  background: #eaf2ff;
  border-radius: 1rem;
  color: #1d4ed8;
  display: inline-flex;
  font-size: 1.5rem;
  height: 3.5rem;
  justify-content: center;
  width: 3.5rem;
}
.workspace-access-card h1 { font-size: 1.65rem; margin: 0.5rem 0 0.75rem; }
.workspace-access-card > p:not(.eyebrow) { color: #64748b; line-height: 1.7; margin: 0 auto; max-width: 27rem; }
.workspace-access-actions { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; margin-top: 1.75rem; }
.workspace-access-actions .secondary-button { align-items: center; display: flex; justify-content: center; text-decoration: none; }

@media (max-width: 639px) {
  .workspace-access-card { margin: 2rem auto; padding: 1.5rem; }
  .workspace-access-actions { grid-template-columns: 1fr; }
}

/* Sales order progress and warehouse shipment reminders */
.sales-order-status-entry { padding: 1.2rem; }
.sales-order-status-entry .section-heading { margin-top: 0; }
.sales-order-status-grid { align-items: stretch; background: #f8fafc; border: 1px solid #dbe5f2; border-radius: 0.9rem; color: #172033; display: grid; gap: 0; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; overflow: hidden; text-decoration: none; }
.sales-order-status-grid > span { border-right: 1px solid #dbe5f2; display: grid; gap: 0.2rem; padding: 0.9rem 1rem; }
.sales-order-status-grid small { color: #64748b; font-size: 0.72rem; }
.sales-order-status-grid strong { font-size: 1.45rem; }
.sales-order-status-grid .is-shipped strong { color: #15803d; }
.sales-order-status-grid .is-unshipped strong { color: #b45309; }
.sales-order-status-grid .is-warehouse strong { color: #1d4ed8; }
.sales-order-status-grid > b { align-items: center; background: #eff6ff; color: #1d4ed8; display: flex; font-size: 0.78rem; padding: 0.9rem 1rem; white-space: nowrap; }
.sales-status-heading .muted { margin-top: 0.4rem; }
.sales-status-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.sales-status-summary article { background: #fff; border: 1px solid #dbe5f2; border-radius: 1rem; box-shadow: 0 8px 24px rgb(15 23 42 / 5%); display: grid; gap: 0.28rem; padding: 1rem 1.1rem; }
.sales-status-summary span { color: #52627a; font-size: 0.78rem; font-weight: 700; }
.sales-status-summary strong { font-size: 1.8rem; }
.sales-status-summary small { color: #718096; font-size: 0.68rem; }
.sales-status-summary .is-shipped { background: #f0fdf4; border-color: #bbf7d0; }
.sales-status-summary .is-unshipped { background: #fffbeb; border-color: #fde68a; }
.sales-status-summary .is-warehouse { background: #eff6ff; border-color: #bfdbfe; }
.sales-status-list-section { padding: 1.2rem; }
.sales-status-list-section .section-heading { margin-top: 0; }
.sales-status-list { display: grid; gap: 0.65rem; }
.sales-status-row { align-items: center; border: 1px solid #e2e8f0; border-left: 4px solid #94a3b8; border-radius: 0.85rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; padding: 0.9rem 1rem; }
.sales-status-row.is-shipped { border-left-color: #22c55e; }
.sales-status-row.is-warehouse { border-left-color: #2563eb; }
.sales-status-row.is-finance { border-left-color: #f59e0b; }
.sales-status-order { display: grid; gap: 0.2rem; min-width: 0; }
.sales-status-order a { color: #1d4ed8; font-size: 0.72rem; overflow-wrap: anywhere; }
.sales-status-order strong { font-size: 0.92rem; }
.sales-status-order small, .sales-status-current small { color: #64748b; font-size: 0.7rem; line-height: 1.4; }
.sales-status-current { display: grid; gap: 0.35rem; }
.sales-status-chip { color: #243044; font-size: 0.82rem; font-weight: 800; }
.sales-status-actions { align-items: center; display: flex; gap: 0.55rem; justify-content: flex-end; }
.sales-status-detail { color: #475569; font-size: 0.74rem; white-space: nowrap; }
.sales-remind-button { font-size: 0.74rem; min-height: 2.25rem; padding: 0.45rem 0.7rem; width: auto; }
.sales-reminded-label { background: #eff6ff; border-radius: 999px; color: #1d4ed8; font-size: 0.7rem; font-weight: 700; padding: 0.4rem 0.65rem; white-space: nowrap; }
.warehouse-sales-reminder { align-items: center; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 0.7rem; color: #9a3412; display: flex; justify-content: space-between; margin: 0.7rem 0; padding: 0.55rem 0.7rem; }
.warehouse-sales-reminder strong { font-size: 0.78rem; }
.warehouse-sales-reminder span { font-size: 0.7rem; }
.warehouse-reminder-priority { background: #fff7ed; border-color: #fed7aa; }

@media (max-width: 760px) {
  .sales-order-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-order-status-grid > span { border-bottom: 1px solid #dbe5f2; }
  .sales-order-status-grid > b { grid-column: 1 / -1; justify-content: center; }
  .sales-status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-status-row { align-items: start; grid-template-columns: 1fr; }
  .sales-status-actions { justify-content: flex-start; }
}

/* Employee account lifecycle */
.account-password-card { max-width: 620px; margin: 5rem auto; }
.account-secret-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.5fr) auto;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 1px solid #78c69d;
  border-radius: 20px;
  background: linear-gradient(135deg, #eaf9f0, #f7fcf9);
}
.account-secret-card h2,
.account-secret-card p { margin: 0; }
.account-secret-card > p { grid-column: 1 / -1; color: #446054; }
.account-secret-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0; }
.account-secret-card dl div { padding: .75rem 1rem; border-radius: 12px; background: #fff; }
.account-secret-card dt { color: #607268; font-size: .82rem; }
.account-secret-card dd { margin: .25rem 0 0; font-weight: 800; }
.account-secret-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.employee-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.employee-create-card { max-width: none; }
.employee-create-card .stacked-form,
.employee-create-card .field-group { display: grid; gap: .5rem; }
.employee-create-card .stacked-form { gap: 1rem; margin-top: 1.25rem; }
.employee-create-card input,
.employee-create-card select,
.employee-create-card button { width: 100%; }
.employee-account-list { display: grid; gap: .75rem; }
.employee-account-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #dbe5df;
  border-radius: 16px;
  background: #fff;
}
.employee-account-row.is-inactive { background: #f4f5f6; opacity: .78; }
.employee-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: #185d43;
  background: #e2f3ea;
  font-size: 1.2rem;
  font-weight: 800;
}
.employee-identity,
.employee-role { display: grid; gap: .2rem; }
.employee-identity span,
.employee-role small { color: #6a7781; font-size: .86rem; }
.employee-account-actions { display: flex; gap: .5rem; }
.employee-account-actions form { margin: 0; }
.employee-account-actions button { white-space: nowrap; }
.employee-password-reveal { position: relative; }
.employee-password-reveal summary {
  cursor: pointer;
  list-style: none;
  min-height: 2.75rem;
  padding: .68rem .8rem;
  border: 1px solid #b9d5c7;
  border-radius: .375rem;
  color: #185d43;
  background: #eef9f3;
  font-weight: 700;
  white-space: nowrap;
}
.employee-password-reveal summary::-webkit-details-marker { display: none; }
.employee-password-reveal > div {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + .45rem);
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto;
  gap: .5rem;
  align-items: center;
  min-width: 18rem;
  padding: .7rem;
  border: 1px solid #b9d5c7;
  border-radius: .65rem;
  background: #fff;
  box-shadow: 0 12px 30px rgb(15 23 42 / 14%);
}
.employee-password-reveal code { overflow-wrap: anywhere; font-weight: 800; }
.employee-password-missing { align-self: center; color: #7b8790; font-size: .82rem; }
.employee-role,
.employee-account-actions { grid-column: 2; }
.employee-account-actions { flex-wrap: wrap; }
.danger-button { color: #a62828; border-color: #f0c6c6; background: #fff4f4; }
.account-event-history { margin-top: 1.25rem; }

@media (max-width: 760px) {
  .account-secret-card,
  .employee-account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-secret-card dl { grid-template-columns: 1fr; }
  .employee-account-actions form,
  .employee-account-actions button { flex: 1 1 auto; }
}

@media (min-width: 1100px) {
  .employee-account-layout {
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.8fr);
  }
  .employee-create-card { position: sticky; top: 1rem; }
  .employee-account-row {
    grid-template-columns: 48px minmax(150px, 1.4fr) minmax(90px, .65fr) auto;
  }
  .employee-role,
  .employee-account-actions { grid-column: auto; }
  .employee-account-actions { flex-wrap: nowrap; }
}

.form-field {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

input,
button {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
}

.copy-button { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 0.45rem; color: #1d4ed8; font-size: 0.75rem; font-weight: 600; margin-top: 0; min-height: 0; padding: 0.2rem 0.55rem; width: auto; }
.copy-button:hover { background: #dbeafe; }

button {
  background: #1d4ed8;
  border: 0;
  border-radius: 0.375rem;
  color: #fff;
  cursor: pointer;
  width: 100%;
}

.form-errors,
.field-error {
  color: #b91c1c;
}

.workspace-heading,
.section-heading,
.form-actions,
.search-form,
.detail-grid,
.metric-grid {
  display: flex;
  gap: 1rem;
}

.workspace-heading,
.section-heading {
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0;
}

.workspace-heading h1,
.section-heading h2 {
  margin: 0;
}

.eyebrow,
.muted,
.form-hint {
  color: #64748b;
  font-size: 0.875rem;
  margin: 0 0 0.25rem;
}

.button-link,
.secondary-button {
  border-radius: 0.375rem;
  display: inline-block;
  padding: 0.625rem 0.75rem;
  text-align: center;
  text-decoration: none;
}

.button-link { background: #1d4ed8; color: #fff; }
.secondary-button { background: #e2e8f0; color: #1f2937; }

.content-card,
.metric-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgb(15 23 42 / 12%);
  margin: 1rem 0;
  padding: 1rem;
}

.metric-grid { flex-wrap: wrap; }
.metric-card { flex: 1 1 9rem; margin: 0; }
.metric-card span,
.detail-grid span,
.readonly-field span { color: #64748b; display: block; font-size: 0.875rem; }
.metric-card strong { display: block; font-size: 1.25rem; margin-top: 0.4rem; }
.sales-goal-progress { margin-top: 1rem; }
.sales-performance-section {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgb(15 23 42 / 6%);
  margin: 1rem 0;
  overflow: hidden;
}
.sales-performance-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  padding: 1.15rem 1.2rem 0.85rem;
}
.sales-performance-heading h2 { margin: 0; }
.sales-performance-heading > p { color: #64748b; font-size: 0.82rem; margin: 0; }
.sales-metric-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 1.2rem 1rem; }
.sales-metric-card { background: #f8fafc; border: 1px solid #e8edf4; border-radius: 0.8rem; min-width: 0; padding: 0.9rem; }
.sales-metric-card span { color: #475569; display: block; font-size: 0.8rem; font-weight: 700; }
.sales-metric-card strong { display: block; font-size: 1.3rem; letter-spacing: -0.03em; margin: 0.35rem 0; overflow-wrap: anywhere; }
.sales-metric-card small { color: #64748b; display: block; font-size: 0.72rem; line-height: 1.45; }
.sales-metric-primary { background: #eff6ff; border-color: #bfdbfe; }
.sales-metric-success { background: #f0fdf4; border-color: #bbf7d0; }
.sales-metric-warning { background: #fffbeb; border-color: #fde68a; }
.sales-quick-stats { background: #f8fafc; border-top: 1px solid #e8edf4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sales-quick-stats div { align-items: center; display: flex; justify-content: space-between; padding: 0.75rem 1.2rem; }
.sales-quick-stats div + div { border-left: 1px solid #e8edf4; }
.sales-quick-stats span { color: #64748b; font-size: 0.78rem; }
.sales-quick-stats strong { font-size: 0.9rem; }
.sales-receivables-section { padding: 1.2rem; }
.sales-receivables-section .section-heading { margin-top: 0; }
.sales-receivable-total { background: #fff7ed; border-radius: 999px; color: #9a3412; font-size: 0.78rem; font-weight: 700; padding: 0.4rem 0.7rem; }
.sales-receivable-list { display: grid; gap: 0.6rem; }
.sales-receivable-row { align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.8rem; color: #172033; display: grid; gap: 0.8rem; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.1fr) 7.5rem 10.5rem; padding: 0.85rem; text-decoration: none; }
.sales-receivable-row:hover { border-color: #93c5fd; box-shadow: 0 6px 18px rgb(37 99 235 / 9%); }
.sales-receivable-row.is-overdue { background: #fff7f7; border-color: #fecaca; }
.sales-receivable-customer strong, .sales-receivable-customer small, .sales-receivable-plan strong, .sales-receivable-plan small, .sales-receivable-amount small, .sales-receivable-amount strong { display: block; }
.sales-receivable-customer small, .sales-receivable-plan small, .sales-receivable-amount small { color: #64748b; font-size: 0.72rem; margin-top: 0.2rem; }
.sales-receivable-row.is-overdue .sales-receivable-plan small { color: #b91c1c; font-weight: 700; }
.sales-receivable-amount { text-align: right; }
.sales-receivable-amount strong { color: #b45309; font-size: 1.05rem; }
.sales-receivable-actions { align-items: center; display: flex; gap: 0.45rem; justify-content: flex-end; white-space: nowrap; }
.sales-receivable-actions a { border-radius: 0.55rem; font-size: 0.76rem; font-weight: 700; padding: 0.5rem 0.65rem; text-decoration: none; }
.sales-receivable-detail-link { color: #475569; }
.sales-receivable-detail-link:hover { background: #e2e8f0; }
.sales-receivable-payment-link { background: #2563eb; color: #fff; }
.sales-receivable-payment-link:hover { background: #1d4ed8; }
.payment-report-entry { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 0.85rem; margin-top: 1rem; padding: 1rem; scroll-margin-top: 1rem; }
.payment-report-entry-heading { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; }
.payment-report-entry-heading h3 { margin: 0.15rem 0 0; }
.payment-report-entry-heading > strong { color: #1d4ed8; font-size: 0.84rem; }
.payment-report-form { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0.9rem; }
.payment-report-form > div { display: grid; gap: 0.35rem; }
.payment-report-form .form-hint { grid-column: 1 / -1; margin: 0; }
.payment-report-form button { grid-column: 1 / -1; justify-self: start; }
.sales-receivable-empty { align-items: center; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 0.8rem; color: #166534; display: flex; justify-content: space-between; padding: 1rem; }
.sales-receivable-empty span { font-size: 0.78rem; }
.sales-tasks-section { padding: 1.2rem; }
.sales-tasks-section .section-heading { margin-top: 0; }
.sales-text-link { color: #1d4ed8; font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.sales-task-list { display: grid; gap: 0.7rem; }
.sales-task-card { align-items: center; border: 1px solid #e2e8f0; border-radius: 0.85rem; color: #172033; display: grid; gap: 0.8rem; grid-template-columns: auto minmax(0, 1fr) auto; padding: 0.85rem; text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.sales-task-card:hover { border-color: #93c5fd; box-shadow: 0 8px 20px rgb(37 99 235 / 10%); transform: translateY(-1px); }
.sales-task-overview { background: #f8fbff; }
.sales-task-shipment { background: #f5fdf7; border-color: #bbf7d0; }
.sales-task-icon { align-items: center; background: #dbeafe; border-radius: 0.7rem; color: #1d4ed8; display: flex; font-size: 0.8rem; font-weight: 800; height: 2.5rem; justify-content: center; width: 2.5rem; }
.sales-task-shipment .sales-task-icon { background: #dcfce7; color: #15803d; }
.sales-task-copy { min-width: 0; }
.sales-task-copy > strong, .sales-task-copy > small { display: block; }
.sales-task-copy > small { color: #64748b; font-size: 0.78rem; margin-top: 0.18rem; }
.sales-task-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.sales-task-tags > span { background: #eaf2ff; border-radius: 999px; color: #315a9e; font-size: 0.7rem; padding: 0.2rem 0.45rem; }
.sales-task-action { color: #1d4ed8; font-size: 0.78rem; font-weight: 700; }
.sales-heading-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: flex-end; }
.sales-heading-actions a { white-space: nowrap; }
.sales-workspace-return { font-weight: 700; }
.role-workspace-heading { align-items: end; margin-bottom: 1rem; }
.role-workspace-heading h1 { margin-bottom: 0.35rem; }
.workspace-module-nav { background: #eef2f7; border: 1px solid #e2e8f0; border-radius: 0.8rem; display: grid; gap: 0.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 0; padding: 0.3rem; }
.workspace-module-nav a { border: 0; border-radius: 0.6rem; color: #475569; display: block; padding: 0.62rem 0.75rem; text-decoration: none; }
.workspace-module-nav a:hover { background: rgb(255 255 255 / 62%); }
.workspace-module-nav a.is-current { background: #fff; box-shadow: 0 1px 4px rgb(15 23 42 / 10%); color: #172033; }
.workspace-module-nav strong, .workspace-module-nav span { display: block; }
.workspace-module-nav strong { font-size: 0.92rem; }
.workspace-module-nav span { color: #64748b; font-size: 0.72rem; margin-top: 0.25rem; }
.warehouse-primary-nav { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 1rem 0 0.55rem; }
.warehouse-primary-nav > a { align-items: center; background: #fff; border: 1px solid #dbe3ec; border-radius: 1rem; color: #334155; display: grid; gap: 0.85rem; grid-template-columns: 2.6rem minmax(0, 1fr); min-height: 5.2rem; padding: 0.9rem 1rem; text-decoration: none; }
.warehouse-primary-nav > a:hover { border-color: #93c5fd; }
.warehouse-primary-nav > a.is-current { background: linear-gradient(135deg, #eff6ff, #eefbf5); border-color: #60a5fa; box-shadow: 0 8px 22px rgb(37 99 235 / 10%); color: #172033; }
.warehouse-primary-icon { align-items: center; background: #e8eef7; border-radius: 0.75rem; color: #1d4ed8; display: flex; font-size: 1.15rem; height: 2.6rem; justify-content: center; width: 2.6rem; }
.warehouse-primary-nav .is-current .warehouse-primary-icon { background: #2563eb; color: #fff; }
.warehouse-primary-nav strong, .warehouse-primary-nav small { display: block; }
.warehouse-primary-nav strong { font-size: 1.05rem; }
.warehouse-primary-nav small { color: #64748b; font-size: 0.7rem; margin-top: 0.2rem; }
.warehouse-secondary-nav { align-items: center; border-bottom: 1px solid #dbe3ec; display: flex; gap: 1.35rem; margin-bottom: 1.1rem; overflow-x: auto; padding: 0 0.2rem; }
.warehouse-secondary-nav a { border-bottom: 3px solid transparent; color: #64748b; flex: 0 0 auto; font-size: 0.76rem; font-weight: 700; padding: 0.65rem 0.1rem 0.55rem; text-decoration: none; }
.warehouse-secondary-nav a.is-current { border-bottom-color: #2563eb; color: #1d4ed8; }
.role-primary-nav { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 1rem 0 0.55rem; }
.role-primary-nav > a { align-items: center; background: #fff; border: 1px solid #dbe3ec; border-radius: 1rem; color: #334155; display: grid; gap: 0.85rem; grid-template-columns: 2.6rem minmax(0, 1fr); min-height: 5.2rem; padding: 0.9rem 1rem; text-decoration: none; }
.role-primary-nav > a:hover { border-color: #93c5fd; }
.role-primary-nav > a.is-current { background: linear-gradient(135deg, #eff6ff, #eefbf5); border-color: #60a5fa; box-shadow: 0 8px 22px rgb(37 99 235 / 10%); color: #172033; }
.role-primary-icon { align-items: center; background: #e8eef7; border-radius: 0.75rem; color: #1d4ed8; display: flex; font-size: 0.9rem; font-weight: 800; height: 2.6rem; justify-content: center; width: 2.6rem; }
.role-primary-nav .is-current .role-primary-icon { background: #2563eb; color: #fff; }
.role-primary-nav strong, .role-primary-nav small { display: block; }
.role-primary-nav strong { font-size: 1.05rem; }
.role-primary-nav small { color: #64748b; font-size: 0.7rem; margin-top: 0.2rem; }
.role-secondary-nav { align-items: center; border-bottom: 1px solid #dbe3ec; display: flex; gap: 1.35rem; margin-bottom: 1.1rem; overflow-x: auto; padding: 0 0.2rem; }
.role-secondary-nav a { border-bottom: 3px solid transparent; color: #64748b; flex: 0 0 auto; font-size: 0.76rem; font-weight: 700; padding: 0.65rem 0.1rem 0.55rem; text-decoration: none; }
.role-secondary-nav a.is-current { border-bottom-color: #2563eb; color: #1d4ed8; }
.owner-cross-workspace-nav > span { color: #94a3b8; flex: 0 0 auto; font-size: 0.68rem; font-weight: 700; }
.workspace-nav-badge {
  align-items: center;
  background: #dc2626;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  margin-left: 0.35rem;
  min-height: 1.1rem;
  min-width: 1.1rem;
  padding: 0.2rem 0.3rem;
  vertical-align: middle;
}
.role-priority-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 0; }
.role-priority-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.9rem; color: #172033; display: block; padding: 1rem; text-decoration: none; }
.role-priority-card span, .role-priority-card small, .role-priority-card strong { display: block; }
.role-priority-card span { color: #64748b; font-size: 0.72rem; font-weight: 700; }
.role-priority-card strong { font-size: 1.55rem; margin: 0.35rem 0 0.15rem; }
.role-priority-card small { color: #475569; font-size: 0.78rem; }
.role-priority-card.primary { background: #eff6ff; border-color: #bfdbfe; }
.role-priority-card.warning { background: #fffbeb; border-color: #fde68a; }
.role-priority-card.danger { background: #fff1f2; border-color: #fecdd3; }
.warehouse-priority-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quiet-action-link { color: #475569; font-size: 0.76rem; text-decoration: underline; text-underline-offset: 0.2rem; }
.workspace-sync-note { align-items: center; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 0.8rem; color: #166534; display: flex; gap: 1rem; justify-content: space-between; margin: 1rem 0; padding: 0.8rem 1rem; }
.workspace-sync-note span { font-size: 0.78rem; }
.workspace-process-note { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.7rem; color: #475569; font-size: 0.75rem; margin: -0.35rem 0 1rem; padding: 0.65rem 0.8rem; }
.workspace-process-note summary { color: #1d4ed8; cursor: pointer; font-weight: 700; }
.workspace-process-note p { margin: 0.55rem 0 0; }
.workspace-secondary-actions { display: grid; gap: 0.7rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.workspace-secondary-actions a { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.8rem; color: #172033; padding: 0.85rem; text-decoration: none; }
.workspace-secondary-actions a:hover { border-color: #93c5fd; }
.workspace-secondary-actions strong, .workspace-secondary-actions span { display: block; }
.workspace-secondary-actions span { color: #64748b; font-size: 0.72rem; margin-top: 0.25rem; }
.workspace-collapsible { padding: 0; }
.workspace-collapsible > summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 1rem 1.2rem; }
.workspace-collapsible > summary::-webkit-details-marker { display: none; }
.workspace-collapsible > summary span small, .workspace-collapsible > summary span strong { display: block; }
.workspace-collapsible > summary small { color: #64748b; font-size: 0.7rem; margin-bottom: 0.25rem; }
.workspace-collapsible > summary b { color: #1d4ed8; font-size: 0.76rem; }
.workspace-collapsible[open] > summary { border-bottom: 1px solid #e2e8f0; }
.workspace-collapsible > :not(summary) { margin: 1rem; }
.warehouse-task-section { padding: 1.2rem; }
.warehouse-task-section .section-heading { margin-top: 0; }
.warehouse-task-list { display: grid; gap: 0.75rem; }
.warehouse-task-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.85rem; overflow: hidden; }
.warehouse-task-card.is-overdue { background: #fff8f8; border-color: #fecaca; }
.warehouse-task-card.is-today { border-color: #bfdbfe; }
.warehouse-task-topline, .warehouse-task-footer { align-items: center; display: flex; gap: 1rem; justify-content: space-between; padding: 0.8rem 0.9rem; }
.warehouse-task-topline { border-bottom: 1px solid #e2e8f0; }
.warehouse-task-topline strong, .warehouse-task-topline span, .warehouse-task-footer span { display: block; }
.warehouse-task-topline > div:first-child span, .warehouse-task-footer span { color: #64748b; font-size: 0.72rem; margin-top: 0.2rem; }
.warehouse-status-chip { background: #e2e8f0; border-radius: 999px; color: #475569; font-size: 0.7rem; font-weight: 700; padding: 0.3rem 0.55rem; }
.warehouse-status-chip.today { background: #dbeafe; color: #1d4ed8; }
.warehouse-status-chip.danger { background: #fee2e2; color: #b91c1c; }
.warehouse-task-products { display: grid; gap: 0.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.75rem 0.9rem; }
.warehouse-task-product { align-items: center; background: #fff; border: 1px solid #edf1f5; border-radius: 0.7rem; display: grid; gap: 0.65rem; grid-template-columns: 2.7rem minmax(0, 1fr) auto; padding: 0.5rem; }
.warehouse-task-product img, .warehouse-task-product .catalog-placeholder { aspect-ratio: 1; border-radius: 0.5rem; height: 2.7rem; object-fit: cover; width: 2.7rem; }
.warehouse-task-product span strong, .warehouse-task-product span small { display: block; }
.warehouse-task-product span small { color: #64748b; font-size: 0.68rem; margin-top: 0.15rem; }
.warehouse-task-product b { color: #1d4ed8; white-space: nowrap; }
.warehouse-task-footer { background: #fff; border-top: 1px solid #e2e8f0; }
.warehouse-task-footer > div { min-width: 0; }
.warehouse-empty-task { align-items: center; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 0.75rem; color: #475569; display: flex; justify-content: space-between; padding: 1rem; }
.warehouse-empty-task span { font-size: 0.75rem; }
.inventory-warning-section { padding: 1.2rem; }
.inventory-warning-section .section-heading { margin-top: 0; }
.inventory-priority-table .inventory-row-actions { min-width: 10rem; }
.inventory-priority-table th:nth-child(n+3):nth-child(-n+6),
.inventory-priority-table td:nth-child(n+3):nth-child(-n+6) {
  min-width: 7.25rem;
  text-align: center;
  vertical-align: middle;
  width: 7.25rem;
}
.inventory-action-primary { background: #dbeafe; border-radius: 0.4rem; color: #1d4ed8 !important; padding: 0.2rem 0.4rem; }
.inventory-row-more { display: inline-block; }
.inventory-row-more summary { color: #64748b; cursor: pointer; font-size: 0.75rem; list-style: none; }
.inventory-row-more summary::-webkit-details-marker { display: none; }
.inventory-row-more summary::after { content: " ▾"; }
.inventory-row-more[open] summary::after { content: " ▴"; }
.inventory-row-more > div { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.45rem; display: grid; gap: 0.25rem; margin-top: 0.35rem; padding: 0.4rem; }
.inventory-row-more > div a { white-space: nowrap; }
.inventory-row-more > div form { margin: 0; }
.inventory-delete-action { background: transparent; color: #b91c1c; font-size: 0.78rem; padding: 0; text-align: left; width: auto; }
.inventory-delete-action:hover { background: transparent; color: #7f1d1d; }
.inventory-choice-guide { align-items: center; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 0.75rem; color: #1e3a8a; display: flex; gap: 0.75rem; margin-top: 1rem; padding: 0.7rem 0.85rem; }
.inventory-choice-guide span { font-size: 0.75rem; }
.inventory-create-actions { margin-top: 0.65rem; }
.inventory-create-choice { position: relative; }
.inventory-create-choice small { color: #64748b; display: block; font-size: 0.66rem; font-weight: 700; margin-bottom: 0.25rem; }
.inventory-create-choice.is-new-product { background: #f0fdf4; border-color: #bbf7d0; }
.inventory-category-catalog { margin-top: 1rem; padding: 1.2rem; }
.inventory-category-heading { align-items: center; margin: 0 0 0.85rem; }
.inventory-category-heading h2 { margin: 0; }
.inventory-catalog-total { color: #64748b; font-size: 0.75rem; margin: 0.3rem 0 0; }
.inventory-catalog-total strong { color: #0f172a; font-size: 0.9rem; margin-left: 0.2rem; }
.inventory-category-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.inventory-category-filter a { align-items: center; background: #f1f5f9; border: 1px solid #dbe3ec; border-radius: 999px; color: #334155; display: flex; gap: 0.45rem; padding: 0.48rem 0.72rem; text-decoration: none; }
.inventory-category-filter a.is-active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.inventory-category-filter strong { font-size: 0.75rem; }
.inventory-category-filter span { align-items: center; background: rgba(255, 255, 255, 0.75); border-radius: 999px; color: #475569; display: inline-flex; font-size: 0.62rem; height: 1.2rem; justify-content: center; min-width: 1.2rem; padding: 0 0.25rem; }
.inventory-category-filter a.is-active span { color: #1d4ed8; }
.inventory-all-product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inventory-all-product-row { align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; display: grid; gap: 0.7rem; grid-template-columns: 3rem minmax(0, 1fr) auto; margin: -1px 0 0 -1px; padding: 0.72rem 0.8rem; }
.inventory-all-product-row > img,
.inventory-all-product-row > .catalog-placeholder { aspect-ratio: 1; border-radius: 0.55rem; height: 3rem; object-fit: cover; width: 3rem; }
.inventory-all-product-actions { display: flex; gap: 0.45rem; }
.inventory-all-product-actions a { color: #1d4ed8; font-size: 0.67rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.inventory-product-identity { display: grid; gap: 0.12rem; min-width: 0; }
.inventory-product-identity small { color: #64748b; font-size: 0.66rem; }
.inventory-product-identity small b { color: #166534; font-size: inherit; }
.inventory-product-identity strong { font-size: 0.86rem; }
.inventory-product-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-end; padding: 0.5rem 1rem; }
.inventory-product-actions a { background: #eef5ff; border-radius: 0.45rem; color: #1d4ed8; font-size: 0.68rem; font-weight: 700; padding: 0.42rem 0.55rem; text-decoration: none; }
.inventory-product-actions a + a { background: #f1f5f9; color: #475569; }
.inventory-specification-list { background: #f8fafc; border-top: 1px solid #edf1f5; }
.inventory-specification-row { align-items: center; display: grid; gap: 0.65rem; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(3.5rem, 0.55fr)) auto; padding: 0.62rem 1rem 0.62rem 5.15rem; }
.inventory-specification-row + .inventory-specification-row { border-top: 1px solid #edf1f5; }
.inventory-specification-row > span { min-width: 0; }
.inventory-specification-row strong, .inventory-specification-row small { display: block; }
.inventory-specification-row strong { font-size: 0.76rem; }
.inventory-specification-row small { color: #64748b; font-size: 0.62rem; }
.inventory-specification-identity { align-items: center; display: flex; gap: 0.55rem; }
.inventory-specification-identity > img,
.inventory-specification-identity > .catalog-placeholder { border-radius: 0.4rem; flex: 0 0 auto; height: 2.3rem; object-fit: cover; width: 2.3rem; }
.inventory-specification-actions { display: flex; gap: 0.45rem; justify-content: flex-end; }
.inventory-specification-actions a { color: #1d4ed8; font-size: 0.67rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.inventory-specification-empty { align-items: center; color: #64748b; display: flex; font-size: 0.7rem; justify-content: space-between; padding: 0.7rem 1rem 0.7rem 5.15rem; }
.inventory-specification-empty a { color: #1d4ed8; font-weight: 700; }
.inventory-product-archive { padding: 0 0 0.25rem; }
.workspace-history-link { align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.9rem; display: flex; justify-content: space-between; margin: 1rem 0; padding: 1rem 1.2rem; }
.workspace-history-link h2, .workspace-history-link p { margin-bottom: 0.2rem; margin-top: 0; }
.workspace-history-link span { color: #64748b; font-size: 0.76rem; }
.finance-money-grid { display: grid; gap: 0.75rem; grid-template-columns: 1.4fr 1.4fr 1fr; }
.finance-money-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.8rem; color: inherit; padding: 1rem; text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.finance-money-card.success { background: #f0fdf4; border-color: #bbf7d0; }
.finance-money-card.warning { background: #fffbeb; border-color: #fde68a; }
.finance-money-card:hover { border-color: #93c5fd; box-shadow: 0 0.65rem 1.4rem rgba(15, 23, 42, 0.08); transform: translateY(-2px); }
.finance-money-card:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.3); outline-offset: 3px; }
.finance-money-card span, .finance-money-card strong, .finance-money-card small, .finance-money-card b { display: block; }
.finance-money-card span { color: #475569; font-size: 0.78rem; font-weight: 700; }
.finance-money-card strong { font-size: 1.5rem; margin: 0.35rem 0; }
.finance-money-card small { color: #64748b; font-size: 0.72rem; }
.finance-money-card b { color: #2563eb; font-size: 0.72rem; margin-top: 0.7rem; }
.finance-action-list { display: grid; gap: 0.65rem; }
.finance-action-list > a { align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.8rem; color: #172033; display: grid; gap: 0.75rem; grid-template-columns: auto minmax(0, 1fr) auto; padding: 0.75rem; text-decoration: none; }
.finance-action-list > a:hover { border-color: #93c5fd; }
.finance-action-list span strong, .finance-action-list span small { display: block; }
.finance-action-list span small { color: #64748b; font-size: 0.72rem; margin-top: 0.15rem; }
.finance-action-list > a > b { color: #1d4ed8; }
.finance-action-icon { align-items: center; background: #dbeafe; border-radius: 0.6rem; color: #1d4ed8; display: flex; font-weight: 800; height: 2.4rem; justify-content: center; width: 2.4rem; }
.finance-action-icon.danger { background: #fee2e2; color: #b91c1c; }
.finance-management-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.finance-dashboard-footer, .owner-dashboard-footer { display: flex; gap: 1rem; justify-content: flex-end; margin: 1rem 0; }
.finance-dashboard-footer a, .owner-dashboard-footer a { color: #1d4ed8; font-size: 0.74rem; font-weight: 700; }
.owner-period-control { align-items: end; display: flex; gap: 0.5rem; }
.owner-period-control label { color: #64748b; font-size: 0.72rem; }
.owner-period-control input, .owner-period-control button { min-height: 2.6rem; }
.owner-kpi-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 1rem 0; }
.owner-kpi-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.9rem; padding: 1rem; }
.owner-kpi-card.primary { background: #eff6ff; border-color: #bfdbfe; }
.owner-kpi-card.success { background: #f0fdf4; border-color: #bbf7d0; }
.owner-kpi-card.warning { background: #fffbeb; border-color: #fde68a; }
.owner-kpi-card span, .owner-kpi-card strong, .owner-kpi-card small { display: block; }
.owner-kpi-card span { color: #475569; font-size: 0.78rem; font-weight: 700; }
.owner-kpi-card strong { font-size: 1.35rem; margin: 0.35rem 0; overflow-wrap: anywhere; }
.owner-kpi-card small { color: #64748b; font-size: 0.7rem; }
.owner-chart-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.8fr); margin: 1rem 0; }
.owner-sales-chart-card { min-width: 0; }
.owner-bar-chart { align-items: end; display: grid; gap: 0.28rem; grid-template-columns: repeat(31, minmax(0.65rem, 1fr)); min-height: 14rem; overflow-x: auto; padding: 1.5rem 0 0.25rem; }
.owner-bar-column { align-items: center; display: grid; grid-template-rows: 1rem 10rem 1rem; min-width: 0.65rem; }
.owner-bar-value { color: #1d4ed8; font-size: 0.52rem; opacity: 0; overflow: visible; text-align: center; white-space: nowrap; }
.owner-bar-column.has-orders:hover .owner-bar-value { opacity: 1; }
.owner-bar-track { align-items: end; background: #f1f5f9; border-radius: 0.35rem 0.35rem 0.15rem 0.15rem; display: flex; height: 100%; overflow: hidden; width: 100%; }
.owner-bar-track i { background: linear-gradient(180deg, #2563eb, #38bdf8); border-radius: 0.35rem 0.35rem 0 0; display: block; height: var(--bar-height); min-height: 0; transition: height 180ms ease; width: 100%; }
.owner-bar-column.has-orders .owner-bar-track i { min-height: 0.35rem; }
.owner-bar-column small { color: #64748b; font-size: 0.5rem; text-align: center; }
.owner-chart-footnote { border-top: 1px solid #e2e8f0; color: #64748b; display: flex; font-size: 0.68rem; justify-content: space-between; margin-top: 0.5rem; padding-top: 0.65rem; }
.owner-donut-layout, .owner-payment-chart { align-items: center; display: grid; gap: 1rem; grid-template-columns: minmax(8rem, 0.8fr) minmax(0, 1.2fr); }
.owner-collection-chart-card { display: flex; flex-direction: column; }
.owner-collection-chart-card .owner-donut-layout { flex: 1; }
.owner-donut { align-items: center; aspect-ratio: 1; border-radius: 50%; display: flex; justify-content: center; margin: auto; max-width: 11rem; position: relative; width: 100%; }
.owner-donut::after { background: #fff; border-radius: 50%; content: ""; inset: 19%; position: absolute; }
.owner-collection-donut { background: conic-gradient(#16a34a 0 var(--collection-share), #f59e0b var(--collection-share) 100%); }
.owner-payment-donut { background: conic-gradient(#2563eb 0 var(--full-stop), #10b981 var(--full-stop) var(--cod-stop), #f59e0b var(--cod-stop) 100%); }
.owner-donut > span { position: relative; text-align: center; z-index: 1; }
.owner-donut strong, .owner-donut small { display: block; }
.owner-donut strong { color: #172033; font-size: 1.25rem; }
.owner-donut small { color: #64748b; font-size: 0.65rem; }
.owner-chart-legend { display: grid; gap: 0.8rem; list-style: none; margin: 0; padding: 0; }
.owner-chart-legend li { align-items: start; display: grid; gap: 0.5rem; grid-template-columns: 0.6rem 1fr; }
.owner-chart-legend i, .owner-payment-methods i { border-radius: 999px; display: block; height: 0.55rem; margin-top: 0.2rem; width: 0.55rem; }
.owner-chart-legend .is-received { background: #16a34a; }
.owner-chart-legend .is-outstanding { background: #f59e0b; }
.owner-chart-legend span, .owner-chart-legend small { display: block; }
.owner-chart-legend span { color: #475569; font-size: 0.72rem; }
.owner-chart-legend small { color: #172033; font-size: 0.85rem; font-weight: 700; margin-top: 0.15rem; }
.owner-todo-total { background: #fee2e2; border-radius: 999px; color: #b91c1c; font-size: 0.75rem; font-weight: 700; padding: 0.35rem 0.65rem; }
.owner-todo-grid { display: grid; gap: 0.65rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.owner-todo-grid a { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; color: #172033; padding: 0.8rem; text-decoration: none; }
.owner-todo-grid a:hover { border-color: #93c5fd; }
.owner-todo-grid span, .owner-todo-grid strong, .owner-todo-grid small { display: block; }
.owner-todo-grid span { color: #64748b; font-size: 0.72rem; }
.owner-todo-grid strong { font-size: 1.1rem; margin: 0.25rem 0; }
.owner-todo-grid small { color: #64748b; font-size: 0.68rem; }
.owner-empty-todo { background: #f0fdf4; border-radius: 0.7rem; color: #166534; margin: 0.75rem 0 0; padding: 0.75rem; text-align: center; }
.owner-profit-primary-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.owner-profit-primary-grid article { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.8rem; padding: 0.9rem; }
.owner-profit-primary-grid span, .owner-profit-primary-grid strong, .owner-profit-primary-grid small { display: block; }
.owner-profit-primary-grid span { color: #64748b; font-size: 0.75rem; }
.owner-profit-primary-grid strong { font-size: 1.25rem; margin: 0.3rem 0; }
.owner-profit-primary-grid small { color: #64748b; font-size: 0.7rem; }
.owner-profit-details { background: #f8fafc; border-radius: 0.7rem; margin-top: 0.75rem; padding: 0.7rem; }
.owner-profit-details summary { color: #1d4ed8; cursor: pointer; font-size: 0.76rem; font-weight: 700; }
.owner-profit-details > div { display: grid; gap: 0.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0.7rem; }
.owner-profit-details span { color: #64748b; font-size: 0.74rem; }
.owner-profit-details strong { color: #172033; display: block; margin-top: 0.2rem; }
.owner-analysis-grid { align-items: start; }
.owner-ranking-list { list-style: none; margin: 0; padding: 0; }
.owner-ranking-list li { align-items: center; border-bottom: 1px solid #e2e8f0; display: grid; gap: 0.65rem; grid-template-columns: 1.5rem minmax(0, 1fr) auto; padding: 0.65rem 0; }
.owner-ranking-list li > b { align-items: center; background: #dbeafe; border-radius: 999px; color: #1d4ed8; display: flex; font-size: 0.7rem; height: 1.5rem; justify-content: center; }
.owner-ranking-list li span strong, .owner-ranking-list li span small, .owner-ranking-list li em small { display: block; }
.owner-ranking-list li span small, .owner-ranking-list li em small { color: #64748b; font-size: 0.68rem; }
.owner-ranking-list li em { font-style: normal; text-align: right; }
.owner-payment-methods { display: grid; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.owner-payment-methods li { align-items: center; background: #f8fafc; border-radius: 0.7rem; display: grid; gap: 0.25rem 0.5rem; grid-template-columns: 0.55rem minmax(0, 1fr) auto; padding: 0.65rem; }
.owner-payment-methods li > i { grid-row: 1 / span 2; }
.owner-payment-methods li > span small { color: #64748b; display: block; font-size: 0.62rem; }
.owner-payment-methods .method-full_payment i { background: #2563eb; }
.owner-payment-methods .method-deposit_cod i { background: #10b981; }
.owner-payment-methods .method-installment i { background: #f59e0b; }
.owner-payment-methods li small { color: #64748b; grid-column: 1 / -1; }
.owner-payment-methods li > small { grid-column: 2 / -1; }
.progress-track {
  background: #e2e8f0;
  border-radius: 999px;
  height: 0.8rem;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, #2563eb, #16a34a);
  display: block;
  height: 100%;
  width: var(--progress-value, 0%);
}
.plain-list,
.ranking-list { margin: 0; padding-left: 1.25rem; }
.ranking-list li { display: flex; justify-content: space-between; padding: 0.5rem 0; }

.sales-manager-heading h1 { max-width: 18ch; }
.sales-manager-today { border-color: #bfdbfe; box-shadow: 0 1rem 2.5rem rgba(37, 99, 235, 0.1); overflow: hidden; position: relative; }
.sales-manager-today::before { background: linear-gradient(90deg, #2563eb, #14b8a6); content: ""; height: 0.3rem; inset: 0 0 auto; position: absolute; }
.today-status { align-items: center; background: #eff6ff; border-radius: 999px; color: #1d4ed8; display: inline-flex; font-size: 0.78rem; font-weight: 700; gap: 0.4rem; padding: 0.42rem 0.7rem; }
.today-status i { background: #22c55e; border-radius: 999px; box-shadow: 0 0 0 0.22rem #dcfce7; height: 0.45rem; width: 0.45rem; }
.today-metric-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
.today-metric { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.85rem; min-width: 0; padding: 1rem; }
.today-metric.primary { background: #eff6ff; border-color: #bfdbfe; }
.today-metric.success { background: #ecfdf5; border-color: #a7f3d0; }
.today-metric.warning { background: #fffbeb; border-color: #fde68a; }
.today-metric span, .today-metric strong, .today-metric small { display: block; }
.today-metric span { color: #475569; font-size: 0.82rem; font-weight: 700; }
.today-metric strong { color: #172033; font-size: clamp(1.35rem, 2.6vw, 2rem); margin-top: 0.4rem; }
.today-metric small { color: #64748b; font-size: 0.72rem; margin-top: 0.3rem; }
.today-team-breakdown { border-top: 1px solid #e2e8f0; margin-top: 1rem; padding-top: 1rem; }
.today-team-breakdown h3 { font-size: 1rem; margin: 0 0 0.7rem; }
.manager-today-table .is-warning { color: #b45309; font-weight: 700; }
.sales-manager-target-progress .section-heading > strong { color: #1d4ed8; font-size: 1.3rem; }
.manager-performance-table td:first-child strong,
.manager-performance-table td:first-child small { display: block; }
.manager-performance-table td:first-child small { color: #64748b; margin-top: 0.2rem; }
.manager-performance-table .is-warning { color: #b45309; font-weight: 700; }
tr.is-overdue td { background: #fff7ed; }
tr.is-overdue td:nth-child(3),
tr.is-overdue td:nth-child(5) { color: #b91c1c; font-weight: 700; }

.step-indicator { display: flex; gap: 0.5rem; list-style: none; margin: 0 0 1rem; overflow-x: auto; padding: 0; }
.step-indicator li { color: #64748b; flex: 0 0 auto; }
.step-indicator .is-current { color: #1d4ed8; font-weight: 700; }
.order-form fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.order-form legend { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.readonly-field { background: #f1f5f9; border-radius: 0.375rem; padding: 0.75rem; }
.payment-extra { margin: 1rem 0; }
.plan-row { display: grid; gap: 0.75rem; grid-template-columns: 1fr 1fr; margin-bottom: 0.75rem; }
.form-actions { flex-wrap: wrap; margin-top: 1.5rem; }
.form-actions button { flex: 1 1 10rem; width: auto; }
.form-requirement-guide { align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.65rem; display: flex; flex-wrap: wrap; font-size: 0.82rem; gap: 0.4rem 0.65rem; margin-bottom: 0.9rem; padding: 0.65rem; }
.field-requirement { border-radius: 999px; display: inline-block; font-size: 0.72rem; font-weight: 700; line-height: 1; padding: 0.28rem 0.42rem; vertical-align: middle; }
.field-requirement.required { background: #fee2e2; color: #991b1b; }
.field-requirement.optional { background: #e2e8f0; color: #475569; }
.order-sync-preview, .workflow-sync-card { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 0.75rem; margin: 1rem 0; padding: 0.85rem; }
.workflow-step-list { display: grid; gap: 0.65rem; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.workflow-step-list.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workflow-step-list li { background: #fff; border: 1px solid #dbeafe; border-radius: 0.6rem; min-width: 0; padding: 0.65rem; }
.workflow-step-list li.is-complete { background: #ecfdf5; border-color: #86efac; }
.workflow-step-list strong, .workflow-step-list span { display: block; overflow-wrap: anywhere; }
.workflow-step-list span { color: #64748b; font-size: 0.78rem; margin-top: 0.25rem; }
.period-filter-form { align-items: end; display: flex; flex-wrap: wrap; gap: 0.65rem; }
.period-filter-form label { color: #475569; display: grid; font-size: 0.85rem; font-weight: 600; gap: 0.3rem; }
.period-filter-form input { border: 1px solid #cbd5e1; border-radius: 0.5rem; font: inherit; min-height: 2.65rem; padding: 0.5rem 0.65rem; }
.period-filter-form button, .period-filter-form a { width: auto; }
.warehouse-queue-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 1rem 0; }
.contact-parser { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; margin: 1rem 0; padding: 0.85rem; }
.contact-parser textarea { border: 1px solid #cbd5e1; border-radius: 0.5rem; font: inherit; margin: 0.5rem 0; min-height: 7rem; padding: 0.7rem; resize: vertical; width: 100%; }
.parse-contact-button { width: auto; }
.contact-parse-result { color: #166534; font-size: 0.875rem; margin-top: 0.5rem; }
.contact-parse-result.has-issues { color: #b45309; }
.contact-field-issue { color: #b91c1c; font-size: 0.82rem; margin: 0.3rem 0 0; }
.has-parse-error { border-color: #dc2626 !important; box-shadow: 0 0 0 1px #dc2626; }
.contact-field-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-address-field { grid-column: 1 / -1; }
.confirmation-field { background: #eff6ff; border-radius: 0.5rem; margin: 1rem 0; padding: 0.75rem; }
.confirmation-field label { align-items: center; display: flex; gap: 0.5rem; }
.confirmation-field input { min-height: auto; }
.sku-toolbar { align-items: end; display: grid; gap: 0.75rem; grid-template-columns: minmax(0, 2fr) minmax(9rem, 1fr); margin: 1rem 0; }
.sku-toolbar label { color: #475569; display: grid; font-size: 0.85rem; gap: 0.35rem; }
.sku-toolbar input, .sku-toolbar select { border: 1px solid #cbd5e1; border-radius: 0.5rem; font: inherit; min-height: 2.75rem; padding: 0.6rem; width: 100%; }
.sku-card-grid { display: grid; gap: 0.55rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sku-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 0.75rem; cursor: pointer; display: grid; gap: 0.35rem; min-width: 0; padding: 0.55rem; position: relative; }
.sku-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgb(37 99 235 / 12%); }
.sku-card.is-out-of-stock { cursor: not-allowed; opacity: 0.62; }
.sku-card[hidden] { display: none; }
.sku-card img, .sku-card-placeholder { aspect-ratio: 1; background: #f1f5f9; border-radius: 0.55rem; display: block; object-fit: cover; width: 100%; }
.sku-card-placeholder { align-items: center; color: #94a3b8; display: flex; justify-content: center; }
.sku-card > strong, .sku-card > span, .sku-card > small { min-width: 0; overflow-wrap: anywhere; }
.sku-card-select { align-items: center; background: rgb(255 255 255 / 92%); border-radius: 999px; display: flex; font-size: 0.78rem; gap: 0.25rem; left: 0.85rem; padding: 0.25rem 0.45rem; position: absolute; top: 0.85rem; }
.sku-card-select input { min-height: auto; }
.stock-danger { color: #be123c; font-weight: 700; }
.add-selected-button { margin: 0.85rem 0; width: 100%; }
.selected-skus { border-top: 1px solid #e2e8f0; margin-top: 1rem; padding-top: 0.25rem; }
.selected-sku-table-wrap { max-height: 26rem; max-width: 100%; overflow: auto; overscroll-behavior: contain; }
.selected-sku-table { min-width: 720px; }
.selected-sku-table thead { background: #fff; position: sticky; top: 0; z-index: 1; }
.selected-sku-table tr.has-error { background: #fff1f2; }
.selected-product-cell { align-items: center; display: flex; gap: 0.6rem; min-width: 12rem; }
.selected-product-cell img, .selected-thumb-placeholder { align-items: center; background: #f1f5f9; border-radius: 0.45rem; display: flex; height: 52px; justify-content: center; object-fit: cover; width: 52px; }
.selected-product-cell strong, .selected-product-cell small { display: block; }
.selected-product-cell small { color: #64748b; margin-top: 0.2rem; }
.quantity-control { align-items: center; display: grid; grid-template-columns: 2.4rem 4.5rem 2.4rem; }
.quantity-control button, .sku-remove-button { min-height: 2.3rem; padding: 0.35rem; width: auto; }
.quantity-control input { border: 1px solid #cbd5e1; min-height: 2.3rem; min-width: 0; padding: 0.35rem; text-align: center; width: 100%; }
.sku-remove-button { background: #e2e8f0; color: #1f2937; }
.search-form { align-items: end; margin: 1rem 0; }
.search-form label { display: block; font-size: 0.875rem; }
.search-form input { flex: 1; }
.search-form button { width: auto; }
.table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.inventory-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { border-collapse: collapse; min-width: 580px; width: 100%; }
th, td { min-width: 7rem; border-bottom: 1px solid #e2e8f0; padding: 0.75rem; text-align: left; }
th { white-space: nowrap; }
.detail-grid { flex-wrap: wrap; }
.detail-grid > div { flex: 1 1 12rem; }
.finance-action-form { display: grid; gap: 0.5rem; min-width: 12rem; }
.finance-action-form label { font-size: 0.875rem; }
.finance-action-form select { min-height: 2.75rem; padding: 0.625rem 0.75rem; }
.finance-workspace-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.finance-workspace-nav a { background: #e2e8f0; border-radius: 999px; color: #1e3a8a; padding: 0.55rem 0.8rem; text-decoration: none; }
.finance-workspace-nav a[aria-current="page"] { background: #1d4ed8; color: #fff; }
.finance-filter-form { align-items: end; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.finance-filter-form p { margin: 0; }
.finance-filter-form label, .finance-grid-form label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.25rem; }
.finance-filter-form input, .finance-grid-form input, .finance-grid-form select, .finance-grid-form textarea { border: 1px solid #cbd5e1; border-radius: 0.375rem; font: inherit; max-width: 100%; min-height: 2.75rem; padding: 0.625rem 0.75rem; width: 100%; }
.finance-filter-form button { width: auto; }
.finance-grid-form { display: grid; gap: 0.25rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-grid-form p { margin: 0.5rem 0; min-width: 0; }
.finance-grid-form button, .finance-grid-form .form-hint, .finance-grid-form > ul.errorlist { grid-column: 1 / -1; }
.finance-grid-form textarea { resize: vertical; }
.finance-wide-table { min-width: 1080px; }
.order-profit-table { min-width: 1320px; }
.order-logistics-cell { min-width: 20rem; }
.order-logistics-current { color: #475569; display: block; font-weight: 600; margin-bottom: 0.5rem; }
.order-logistics-inline-form { align-items: end; display: grid; gap: 0.5rem; grid-template-columns: minmax(7rem, 0.8fr) minmax(9rem, 1.2fr) auto; }
.order-logistics-inline-form label { color: #475569; display: grid; font-size: 0.78rem; gap: 0.2rem; }
.order-logistics-inline-form input { border: 1px solid #cbd5e1; border-radius: 0.375rem; font: inherit; min-height: 2.5rem; min-width: 0; padding: 0.5rem 0.6rem; width: 100%; }
.order-logistics-inline-form button { min-height: 2.5rem; padding: 0.5rem 0.8rem; width: auto; }
.finance-form-error-summary { border-left: 0.35rem solid #b91c1c; }
.payroll-table { min-width: 1720px; }
.source-row td { background: #f8fafc; font-size: 0.85rem; white-space: normal; }
.source-row a { display: inline-block; margin: 0.25rem; }
.blocker-panel { border-left: 0.35rem solid #b45309; }
.blocker-panel h2, .blocker-summary { color: #92400e; }
.negative-value { color: #b91c1c; font-weight: 700; }
.inline-command-form { max-width: 24rem; }
.inline-command-form button:disabled { background: #94a3b8; cursor: not-allowed; }
.metric-card small { color: #64748b; display: block; margin-top: 0.25rem; }
.errorlist { color: #b91c1c; }

.owner-dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-workspace { width: 100%; }
.inventory-heading-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.inventory-heading-actions a { white-space: nowrap; }
.inventory-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inventory-summary div { background: #f8fafc; border-radius: 0.65rem; padding: 0.85rem; }
.inventory-summary span, .inventory-summary small { color: #64748b; display: block; font-size: 0.8rem; }
.inventory-summary strong { display: block; font-size: 1.5rem; margin: 0.25rem 0; }
.inventory-table { min-width: 940px; }
.catalog-thumb, .product-admin-card img { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 0.65rem; height: 64px; object-fit: cover; width: 64px; }
.catalog-placeholder { align-items: center; background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 0.65rem; color: #94a3b8; display: inline-flex; height: 64px; justify-content: center; width: 64px; }
.stock-number { font-variant-numeric: tabular-nums; text-align: center; }
.stock-low { background: #fffbeb; }
.stock-out { background: #fff1f2; }
.warning-badge, .status-pill { background: #fef3c7; border-radius: 999px; color: #92400e; display: inline-block; font-size: 0.75rem; padding: 0.25rem 0.5rem; white-space: nowrap; }
.warning-badge.danger { background: #ffe4e6; color: #be123c; }
.status-pill.is-active { background: #dcfce7; color: #166534; }
.status-pill.is-inactive { background: #e2e8f0; color: #475569; }
.inventory-row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; min-width: 11rem; }
.inventory-row-actions a { color: #1d4ed8; white-space: nowrap; }
.product-admin-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-admin-card { align-items: center; border: 1px solid #e2e8f0; border-radius: 0.75rem; display: flex; gap: 0.75rem; min-width: 0; padding: 0.75rem; }
.product-admin-card p { color: #64748b; font-size: 0.85rem; margin: 0.25rem 0; }
.product-admin-card a { color: #1d4ed8; font-size: 0.875rem; }
.catalog-form { display: grid; gap: 0.25rem; }
.catalog-form input, .catalog-form select { border: 1px solid #cbd5e1; border-radius: 0.375rem; font: inherit; max-width: 100%; min-height: 2.75rem; padding: 0.625rem 0.75rem; width: 100%; }
.catalog-form input[type="checkbox"] { min-height: auto; width: auto; }
.permission-note { background: #eff6ff; border-radius: 0.5rem; color: #1e40af; padding: 0.75rem; }
.empty-state { color: #64748b; padding: 1.5rem; text-align: center; }
.replenishment-product { align-items: center; display: flex; gap: 0.75rem; min-width: 15rem; }
.replenishment-detail-card { align-items: start; display: grid; gap: 1rem; grid-template-columns: minmax(8rem, 12rem) 1fr; }
.replenishment-detail-image img { aspect-ratio: 1; border-radius: 0.75rem; display: block; object-fit: cover; width: 100%; }
.warehouse-order-product { align-items: center; display: flex; gap: 0.65rem; min-width: 16rem; }
.warehouse-pick-list { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.warehouse-pick-item { align-items: center; border: 1px solid #e2e8f0; border-radius: 0.75rem; display: flex; gap: 0.85rem; padding: 0.75rem; }
.warehouse-pick-item img { aspect-ratio: 1; border-radius: 0.65rem; height: 84px; object-fit: cover; width: 84px; }
.warehouse-pick-item p { color: #64748b; margin: 0.25rem 0; }
.warehouse-pick-quantity { color: #1d4ed8; font-size: 1.15rem; font-weight: 700; }
.warehouse-address-field { align-content: start; display: grid; gap: 0.35rem; grid-template-columns: minmax(0, 1fr); }
.warehouse-address-field > span, .warehouse-address-field > strong { grid-column: 1; }
.warehouse-copy-address { grid-column: 1; justify-self: start; margin: 0.25rem 0 0; min-height: 2.25rem; padding: 0.4rem 0.65rem; white-space: nowrap; width: auto; }

@media (max-width: 639px) {
  .workspace-heading,
  .section-heading,
  .search-form { align-items: stretch; flex-direction: column; }
  .button-link { width: 100%; }
  .ranking-list li { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .plan-row { grid-template-columns: 1fr; }
  .contact-field-grid, .sku-toolbar { grid-template-columns: 1fr; }
  .workflow-step-list, .workflow-step-list.compact, .warehouse-queue-summary { grid-template-columns: 1fr; }
  .period-filter-form { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .period-filter-form button, .period-filter-form a { width: 100%; }
  .form-actions { background: rgb(255 255 255 / 96%); bottom: 0; box-shadow: 0 -8px 20px rgb(15 23 42 / 8%); margin-inline: -0.8rem; padding: 0.7rem 0.8rem; position: sticky; z-index: 4; }
  .site-header { align-items: flex-start; }
  .site-header nav { align-items: flex-end; flex-direction: column; gap: 0.4rem; }
  .inventory-heading-actions { justify-content: stretch; width: 100%; }
  .inventory-heading-actions a { flex: 1 1 9rem; }
  .inventory-summary, .product-admin-grid { grid-template-columns: 1fr; }
  .replenishment-detail-card { grid-template-columns: 1fr; }
  .replenishment-detail-image { max-width: 10rem; }
  .content-card { padding: 0.8rem; }
  .sales-performance-heading { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .sales-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 0.8rem; }
  .sales-quick-stats { grid-template-columns: 1fr; }
  .sales-quick-stats div + div { border-left: 0; border-top: 1px solid #e8edf4; }
  .sales-task-card { align-items: start; grid-template-columns: auto minmax(0, 1fr); }
  .sales-task-action { grid-column: 2; }
  .sales-receivable-row { align-items: start; grid-template-columns: minmax(0, 1fr) auto; }
  .sales-receivable-plan { grid-column: 1; }
  .sales-receivable-amount { grid-column: 2; grid-row: 1 / span 2; }
  .sales-receivable-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .payment-report-entry-heading { display: grid; }
  .payment-report-form { grid-template-columns: 1fr; }
  .payment-report-form .form-hint, .payment-report-form button { grid-column: 1; }
  .sales-receivable-empty { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .sales-heading-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .sales-heading-actions a { width: 100%; }
  .finance-workspace-nav { align-items: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-workspace-nav a { overflow-wrap: anywhere; text-align: center; }
  .finance-filter-form, .finance-grid-form { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .finance-grid-form, .finance-filter-form { grid-template-columns: 1fr; }
  .finance-filter-form button, .finance-grid-form button { width: 100%; }
  .role-workspace-heading { align-items: stretch; }
  .workspace-module-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-primary-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-primary-nav > a { align-items: start; gap: 0.5rem; grid-template-columns: 1fr; min-height: 6.6rem; padding: 0.75rem; }
  .warehouse-primary-nav strong { font-size: 0.88rem; }
  .warehouse-primary-nav small { font-size: 0.64rem; }
  .warehouse-secondary-nav { gap: 1rem; }
  .role-primary-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-primary-nav > a { align-items: start; gap: 0.5rem; grid-template-columns: 1fr; min-height: 6.6rem; padding: 0.75rem; }
  .role-primary-nav strong { font-size: 0.88rem; }
  .role-primary-nav small { font-size: 0.64rem; }
  .role-secondary-nav { gap: 1rem; }
  .role-priority-grid, .owner-kpi-grid, .owner-todo-grid, .today-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .owner-chart-grid { grid-template-columns: 1fr; }
  .owner-bar-chart { grid-template-columns: repeat(31, minmax(0.95rem, 1fr)); width: 100%; }
  .owner-donut-layout, .owner-payment-chart { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .workspace-sync-note { align-items: flex-start; flex-direction: column; gap: 0.3rem; }
  .workspace-secondary-actions, .finance-management-actions { grid-template-columns: 1fr; }
  .warehouse-task-products { grid-template-columns: 1fr; }
  .warehouse-task-topline, .warehouse-task-footer { align-items: flex-start; flex-direction: column; }
  .warehouse-task-footer .button-link, .warehouse-task-footer .secondary-button { text-align: center; width: 100%; }
  .warehouse-empty-task { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .inventory-choice-guide { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .inventory-category-catalog { padding: 0.8rem; }
  .inventory-category-heading { align-items: stretch; }
  .inventory-category-heading .button-link { text-align: center; width: 100%; }
  .inventory-all-product-list { grid-template-columns: 1fr; }
  .inventory-all-product-row { grid-template-columns: 3rem minmax(0, 1fr); padding: 0.7rem; }
  .inventory-all-product-actions { grid-column: 2; }
  .inventory-specification-row { grid-template-columns: minmax(0, 1fr) repeat(3, 3rem); padding: 0.65rem 0.75rem; }
  .inventory-specification-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .inventory-specification-empty { align-items: flex-start; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0.75rem; }
  .workspace-collapsible > summary { gap: 0.75rem; }
  .workspace-history-link { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .workspace-history-link a { text-align: center; width: 100%; }
  .finance-money-grid, .owner-profit-primary-grid { grid-template-columns: 1fr; }
  .finance-action-list > a { grid-template-columns: auto minmax(0, 1fr); }
  .finance-action-list > a > b { grid-column: 2; }
  .owner-period-control { align-items: stretch; display: grid; grid-template-columns: 1fr auto; }
  .owner-period-control label { grid-column: 1 / -1; }
  .owner-profit-details > div { grid-template-columns: 1fr; }
  .finance-dashboard-footer, .owner-dashboard-footer { align-items: flex-start; flex-direction: column; gap: 0.55rem; }
}

@media (max-width: 760px) {
  .owner-dashboard-grid { grid-template-columns: 1fr; }
}

@media (min-width: 640px) {
  .site-header,
  .page-content {
    padding: 1.5rem;
  }
  .sku-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 840px) {
  .sku-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .site-header,
  .page-content { max-width: 1180px; }
}

@media (min-width: 1100px) {
  .sku-card-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Modern sales order workspace */
.sales-order-page {
  --order-accent: #5b5bd6;
  --order-accent-dark: #4747b8;
  --order-ink: #172033;
  --order-muted: #697386;
  --order-line: #e7e9f2;
  --order-soft: #f5f6fb;
  margin: 0 auto 4rem;
  max-width: 1180px;
}

.sales-order-hero {
  align-items: end;
  background:
    radial-gradient(circle at 92% 18%, rgb(255 255 255 / 18%) 0 8%, transparent 8.5%),
    linear-gradient(135deg, #17172b 0%, #34306c 55%, #5b5bd6 100%);
  border-radius: 1.6rem;
  box-shadow: 0 24px 60px rgb(38 38 90 / 18%);
  color: #fff;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 1rem 0 1.2rem;
  overflow: hidden;
  padding: 2rem 2.2rem;
  position: relative;
}

.sales-order-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.04em; margin: 0.15rem 0 0.6rem; }
.sales-order-hero p { color: rgb(255 255 255 / 74%); line-height: 1.65; margin: 0; max-width: 43rem; }
.sales-order-hero .eyebrow { color: #c7d2fe; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; }
.sales-order-back { color: rgb(255 255 255 / 74%); display: inline-block; font-size: 0.85rem; margin-bottom: 1.5rem; text-decoration: none; }
.sales-order-back:hover { color: #fff; }
.sales-order-operator { backdrop-filter: blur(10px); background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 16%); border-radius: 1rem; min-width: 12rem; padding: 1rem 1.1rem; }
.sales-order-operator span, .sales-order-operator small { color: rgb(255 255 255 / 64%); display: block; font-size: 0.75rem; }
.sales-order-operator strong { display: block; font-size: 1.05rem; margin: 0.25rem 0 0.55rem; }

.order-form-modern { color: var(--order-ink); }
.order-form-modern [hidden] { display: none !important; }
.order-form-modern select,
.order-form-modern textarea,
.order-form-modern input:not([type="checkbox"]):not([type="hidden"]) {
  background: #fff;
  border: 1px solid #d9ddea;
  border-radius: 0.75rem;
  color: var(--order-ink);
  font: inherit;
  min-height: 2.9rem;
  outline: 0;
  padding: 0.7rem 0.8rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  width: 100%;
}
.order-form-modern textarea { min-height: 6rem; resize: vertical; }
.order-form-modern select:focus,
.order-form-modern textarea:focus,
.order-form-modern input:not([type="checkbox"]):not([type="hidden"]):focus { border-color: var(--order-accent); box-shadow: 0 0 0 3px rgb(91 91 214 / 12%); }
.order-form-modern .form-field { gap: 0.45rem; margin: 0.9rem 0; }
.order-form-modern .form-field > label { color: #394156; font-size: 0.82rem; font-weight: 700; }
.order-form-modern .form-hint { color: var(--order-muted); font-size: 0.77rem; line-height: 1.5; }

.order-form-topbar {
  align-items: center;
  background: rgb(255 255 255 / 96%);
  border: 1px solid var(--order-line);
  border-radius: 1.2rem;
  box-shadow: 0 10px 30px rgb(24 32 51 / 6%);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}
.order-form-modern .step-indicator { display: grid; gap: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; overflow: visible; position: relative; }
.order-form-modern .step-indicator::before { background: #e4e6ef; content: ""; height: 2px; left: 8%; position: absolute; right: 8%; top: 1.05rem; }
.order-form-modern .step-indicator li { align-items: center; color: #9299aa; display: grid; flex: initial; gap: 0.15rem; justify-items: center; min-width: 0; position: relative; text-align: center; }
.order-form-modern .step-indicator li > span { align-items: center; background: #eef0f6; border: 4px solid #fff; border-radius: 50%; color: #7b8497; display: flex; font-size: 0.72rem; font-weight: 800; height: 2.2rem; justify-content: center; margin-bottom: 0.25rem; width: 2.2rem; z-index: 1; }
.order-form-modern .step-indicator strong { color: inherit; font-size: 0.82rem; }
.order-form-modern .step-indicator small { color: #a0a7b5; font-size: 0.68rem; }
.order-form-modern .step-indicator li.is-current { color: var(--order-accent); }
.order-form-modern .step-indicator li.is-current > span { background: var(--order-accent); box-shadow: 0 5px 14px rgb(91 91 214 / 28%); color: #fff; }
.order-form-modern .step-indicator li.is-complete { color: #3c7d5c; }
.order-form-modern .step-indicator li.is-complete > span { background: #dff3e7; color: #23724c; }
.order-form-modern .form-requirement-guide { background: var(--order-soft); border: 0; margin: 0; white-space: nowrap; }
.order-form-modern .field-requirement { font-size: 0.65rem; letter-spacing: 0.02em; }
.order-form-modern .field-requirement.required { background: #fff0f1; color: #c24157; }
.order-form-modern .field-requirement.optional { background: #edf0f7; color: #697386; }

.order-form-stage {
  background: #fff;
  border: 1px solid var(--order-line);
  border-radius: 1.4rem;
  box-shadow: 0 18px 48px rgb(24 32 51 / 7%);
  min-width: 0;
  padding: 1.5rem;
}
.order-form-modern fieldset > legend { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0 0 0 0); }
.step-panel-heading { align-items: center; border-bottom: 1px solid #eff0f5; display: flex; gap: 0.9rem; margin-bottom: 1.25rem; padding-bottom: 1.1rem; }
.step-panel-number { color: #d5d7e2; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.06em; }
.step-panel-heading h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin: 0; }
.step-panel-heading p { color: var(--order-muted); font-size: 0.84rem; margin: 0.25rem 0 0; }

.customer-choice-layout, .payment-layout, .shipping-layout { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-choice-card, .form-section-card, .new-customer-fields { background: var(--order-soft); border: 1px solid transparent; border-radius: 1rem; min-width: 0; padding: 1rem; }
.customer-choice-card:focus-within, .form-section-card:focus-within { background: #fff; border-color: #d9d7f5; box-shadow: 0 8px 22px rgb(91 91 214 / 8%); }
.order-form-modern .contact-parser { margin: 0; }
.choice-card-heading { align-items: center; display: flex; gap: 0.7rem; margin-bottom: 0.8rem; }
.choice-card-heading strong, .choice-card-heading small { display: block; }
.choice-card-heading strong { font-size: 0.92rem; }
.choice-card-heading small { color: var(--order-muted); font-size: 0.72rem; margin-top: 0.15rem; }
.choice-icon { align-items: center; background: #e9f7ef; border-radius: 0.7rem; color: #188653; display: flex; flex: 0 0 auto; font-size: 1rem; font-weight: 900; height: 2.25rem; justify-content: center; width: 2.25rem; }
.choice-icon.is-accent { background: #eaeafd; color: var(--order-accent); }
.order-form-modern .contact-parser textarea { margin: 0.45rem 0; min-height: 6.35rem; }
.order-form-modern .parse-contact-button { background: #e7e8f1; color: #34394b; min-height: 2.55rem; padding: 0.55rem 0.75rem; width: 100%; }
.new-customer-fields { background: #fff; border-color: var(--order-line); margin-top: 1rem; }
.compact-heading { margin: 0 0 0.5rem; }
.compact-heading h2 { font-size: 1rem; }
.compact-heading .eyebrow { color: var(--order-accent); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.14em; }
.order-form-modern .confirmation-field { background: #f0efff; border: 1px solid #dfdef8; border-radius: 0.75rem; color: #3f3f78; }

.sku-selection-workspace { align-items: start; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.9fr) minmax(16rem, 0.8fr); }
.order-form-modern .sku-picker { min-width: 0; }
.order-form-modern .sku-toolbar { background: var(--order-soft); border-radius: 0.9rem; gap: 0.65rem; grid-template-columns: minmax(0, 1fr) 9rem; margin: 0 0 0.8rem; padding: 0.65rem; }
.order-form-modern .sku-toolbar label { font-size: 0.72rem; font-weight: 700; }
.order-form-modern .sku-toolbar input, .order-form-modern .sku-toolbar select { background: #fff; min-height: 2.55rem; }
.order-form-modern .sku-card-grid { display: grid; gap: 0.65rem; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
.order-form-modern .sku-card { border: 1px solid var(--order-line); border-radius: 0.9rem; gap: 0; overflow: hidden; padding: 0; transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
.order-form-modern .sku-card:hover { border-color: #bebce8; box-shadow: 0 9px 24px rgb(24 32 51 / 9%); transform: translateY(-2px); }
.order-form-modern .sku-card.is-selected { border-color: var(--order-accent); box-shadow: 0 0 0 2px rgb(91 91 214 / 10%), 0 10px 24px rgb(91 91 214 / 12%); }
.sku-card-checkbox { height: 1px; opacity: 0; position: absolute; width: 1px; }
.sku-card-check { align-items: center; background: rgb(255 255 255 / 92%); border: 1px solid #d8dbe5; border-radius: 50%; color: transparent; display: flex; font-size: 0.7rem; height: 1.6rem; justify-content: center; left: 0.55rem; position: absolute; top: 0.55rem; transition: 150ms ease; width: 1.6rem; z-index: 2; }
.sku-card.is-selected .sku-card-check { background: var(--order-accent); border-color: var(--order-accent); color: #fff; }
.sku-card-media { background: #f0f1f5; display: block; height: 96px; overflow: hidden; }
.order-form-modern .sku-card-media img, .order-form-modern .sku-card-placeholder { border-radius: 0; height: 100%; object-fit: cover; width: 100%; }
.order-form-modern .sku-card-placeholder { align-items: center; display: flex; font-size: 0.72rem; justify-content: center; }
.sku-card-body { display: grid; gap: 0.16rem; padding: 0.65rem 0.65rem 0.45rem; }
.sku-card-body strong { color: var(--order-ink); font-size: 0.82rem; line-height: 1.35; }
.sku-card-body span { color: #5c6475; font-size: 0.72rem; }
.sku-card-body small { color: #a0a6b3; font-size: 0.65rem; }
.sku-stock { align-items: center; color: #347457; display: flex; font-size: 0.68rem; font-weight: 700; gap: 0.3rem; padding: 0 0.65rem 0.65rem; }
.sku-stock i { background: #31a56e; border-radius: 50%; display: inline-block; height: 0.35rem; width: 0.35rem; }
.order-form-modern .stock-danger { color: #c24157; }
.order-form-modern .add-selected-button { background: var(--order-accent); border-radius: 0.75rem; box-shadow: 0 8px 20px rgb(91 91 214 / 18%); margin: 0.8rem 0 0; min-height: 2.7rem; }

.order-form-modern .selected-skus { background: #171827; border: 0; border-radius: 1rem; color: #fff; margin: 0; max-height: calc(100vh - 8rem); min-width: 0; overflow: auto; padding: 0.9rem; position: sticky; top: 1rem; }
.selected-skus-heading { align-items: end; border-bottom: 1px solid rgb(255 255 255 / 10%); display: flex; justify-content: space-between; padding: 0.15rem 0.1rem 0.75rem; }
.selected-skus-heading h2 { font-size: 1rem; margin: 0.1rem 0 0; }
.selected-skus-heading .eyebrow { color: #9898e8; font-size: 0.6rem; letter-spacing: 0.12em; }
.selected-skus-heading > span { background: rgb(255 255 255 / 8%); border-radius: 999px; color: #c9cad7; font-size: 0.7rem; padding: 0.35rem 0.55rem; }
.selected-sku-list { display: grid; gap: 0.55rem; margin-top: 0.7rem; }
.selected-sku-item { background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 8%); border-radius: 0.75rem; display: grid; gap: 0.55rem; padding: 0.65rem; }
.selected-sku-item.has-error { border-color: #fb7185; }
.order-form-modern .selected-product-cell { gap: 0.5rem; min-width: 0; }
.order-form-modern .selected-product-cell img, .order-form-modern .selected-thumb-placeholder { background: #2b2c3d; border-radius: 0.55rem; flex: 0 0 auto; height: 42px; width: 42px; }
.order-form-modern .selected-product-cell strong { color: #fff; font-size: 0.75rem; }
.order-form-modern .selected-product-cell small { color: #aeb1c0; font-size: 0.64rem; line-height: 1.35; }
.selected-sku-controls { align-items: center; display: flex; gap: 0.45rem; justify-content: space-between; }
.order-form-modern .quantity-control { grid-template-columns: 1.9rem 2.7rem 1.9rem; }
.order-form-modern .quantity-control button { background: rgb(255 255 255 / 10%); border-radius: 0.45rem; color: #fff; min-height: 1.9rem; }
.order-form-modern .quantity-control input { background: transparent !important; border: 0 !important; box-shadow: none !important; color: #fff; min-height: 1.9rem !important; padding: 0.2rem; }
.order-form-modern .sku-remove-button { background: transparent; color: #b8bac7; font-size: 0.68rem; min-height: 1.9rem; padding: 0.2rem 0.35rem; }
.selected-stock { color: #8f92a2; font-size: 0.62rem; }
.selected-empty { align-items: center; color: #a8aaba; display: flex; flex-direction: column; gap: 0.3rem; justify-content: center; min-height: 10rem; padding: 1rem; text-align: center; }
.selected-empty > span { align-items: center; border: 1px dashed #565869; border-radius: 50%; display: flex; font-size: 1.2rem; height: 2.8rem; justify-content: center; width: 2.8rem; }
.selected-empty strong { color: #d7d8df; font-size: 0.8rem; }
.selected-empty small { font-size: 0.66rem; line-height: 1.5; }
.order-amount-field { border-top: 1px solid rgb(255 255 255 / 10%); margin-top: 0.75rem !important; padding-top: 0.75rem; }
.order-form-modern .order-amount-field > label { color: #d8d9e2; }
.money-input { align-items: center; background: #fff; border: 1px solid #d9ddea; border-radius: 0.75rem; display: flex; overflow: hidden; }
.money-input > span { color: #9298a7; padding-left: 0.75rem; }
.order-form-modern .money-input input { border: 0 !important; box-shadow: none !important; }

.payment-layout, .shipping-layout { align-items: stretch; }
.form-section-card { padding: 1rem 1.1rem; }
.upload-card { background: linear-gradient(145deg, #f2f1ff, #f8f7ff); border-color: #e1dff8; }
.installment-panel { border-top: 1px solid var(--order-line); padding-top: 0.8rem; }
.order-form-modern .plan-row label { color: #394156; display: grid; font-size: 0.75rem; font-weight: 700; gap: 0.4rem; }

.order-form-modern .order-sync-preview { background: #f2f8f5; border: 1px solid #d8ece1; border-radius: 1rem; margin: 1rem 0 0; padding: 1rem; }
.order-form-modern .order-sync-preview > div { align-items: center; display: flex; gap: 0.65rem; margin-bottom: 0.8rem; }
.order-form-modern .order-sync-preview h2 { color: #1f513b; font-size: 0.95rem; margin: 0; }
.order-form-modern .order-sync-preview .eyebrow { color: #5c8c72; font-size: 0.62rem; letter-spacing: 0.12em; }
.sync-status-icon { align-items: center; background: #d9eee2; border-radius: 50%; color: #188653; display: flex; font-weight: 900; height: 2.1rem; justify-content: center; width: 2.1rem; }
.order-form-modern .workflow-step-list { gap: 0.45rem; }
.order-form-modern .workflow-step-list li { background: rgb(255 255 255 / 68%); border: 0; padding: 0.55rem 0.65rem; }
.order-form-modern .workflow-step-list strong { color: #284d3a; font-size: 0.74rem; }
.order-form-modern .workflow-step-list span { color: #719080; font-size: 0.66rem; }

.order-form-alert { background: #fff4f5; border: 1px solid #ffd7dc; border-radius: 0.8rem; margin: 0 0 1rem; padding: 0.75rem 1rem; }
.order-form-modern .order-form-actions { align-items: center; background: rgb(255 255 255 / 96%); border: 1px solid var(--order-line); border-radius: 1rem; box-shadow: 0 12px 36px rgb(24 32 51 / 12%); bottom: 0.75rem; flex-wrap: nowrap; margin: 1rem 0 0; padding: 0.65rem; position: sticky; z-index: 5; }
.order-form-modern .order-form-actions button { border-radius: 0.7rem; flex: 0 0 auto; min-width: 7.5rem; width: auto; }
.order-form-modern .order-form-actions [data-next], .order-form-modern .order-form-actions [data-submit-order] { background: var(--order-accent); }
.order-form-modern .order-form-actions [data-next]:hover, .order-form-modern .order-form-actions [data-submit-order]:hover { background: var(--order-accent-dark); }
.step-action-hint { color: var(--order-muted); flex: 1 1 auto; font-size: 0.75rem; padding: 0 0.4rem; }

@media (max-width: 900px) {
  .sales-order-hero { align-items: start; grid-template-columns: 1fr; }
  .sales-order-operator { max-width: 18rem; }
  .order-form-topbar { grid-template-columns: 1fr; }
  .order-form-modern .form-requirement-guide { justify-self: start; }
  .sku-selection-workspace { grid-template-columns: 1fr; }
  .order-form-modern .selected-skus { max-height: none; position: static; }
}

@media (max-width: 639px) {
  .sales-order-page { margin-inline: -0.15rem; }
  .sales-order-hero { border-radius: 1.15rem; gap: 1.2rem; padding: 1.35rem; }
  .sales-order-hero h1 { font-size: 2rem; }
  .sales-order-back { margin-bottom: 1rem; }
  .sales-order-operator { min-width: 0; width: 100%; }
  .order-form-topbar { border-radius: 1rem; padding: 0.75rem 0.45rem; }
  .order-form-modern .step-indicator small { display: none; }
  .order-form-modern .step-indicator::before { left: 10%; right: 10%; }
  .order-form-modern .form-requirement-guide { display: none; }
  .order-form-stage { border-radius: 1rem; padding: 1rem 0.8rem; }
  .step-panel-heading { align-items: flex-start; }
  .step-panel-heading p { line-height: 1.5; }
  .customer-choice-layout, .payment-layout, .shipping-layout { grid-template-columns: 1fr; }
  .contact-field-grid { grid-template-columns: 1fr; }
  .contact-address-field { grid-column: auto; }
  .order-form-modern .sku-toolbar { grid-template-columns: 1fr; }
  .order-form-modern .sku-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sku-card-media { height: 82px; }
  .order-form-modern .order-form-actions { border-bottom-left-radius: 0; border-bottom-right-radius: 0; bottom: 0; margin-inline: -1rem; padding: 0.55rem 0.65rem; }
  .order-form-modern .order-form-actions button { min-width: 0; padding-inline: 0.65rem; }
  .step-action-hint { display: none; }
  .order-form-modern .workflow-step-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sales order simplification pass */
.sales-order-page { --order-accent: #2563eb; --order-accent-dark: #1d4ed8; }
.sales-order-hero {
  align-items: center;
  background: transparent;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
  color: #111827;
  gap: 1rem;
  margin: 0 0 1rem;
  overflow: visible;
  padding: 1rem 0 1.25rem;
}
.sales-order-hero h1 { font-size: clamp(1.65rem, 3vw, 2.2rem); letter-spacing: -0.035em; margin: 0.35rem 0 0.25rem; }
.sales-order-hero p { color: #6b7280; font-size: 0.86rem; }
.sales-order-back { color: #6b7280; margin-bottom: 0; }
.sales-order-operator { backdrop-filter: none; background: #f3f4f6; border: 0; border-radius: 999px; display: flex; gap: 0.4rem; min-width: 0; padding: 0.5rem 0.75rem; }
.sales-order-operator span { color: #6b7280; }
.sales-order-operator strong { color: #111827; font-size: 0.75rem; margin: 0; }
.order-form-topbar { border: 0; border-bottom: 1px solid #e5e7eb; border-radius: 0; box-shadow: none; display: block; padding: 0.6rem 0 1rem; }
.order-form-modern .step-indicator::before { background: #e5e7eb; }
.order-form-modern .step-indicator li > span { border-color: #fff; }
.order-form-modern .step-indicator li.is-current > span { box-shadow: none; }
.order-form-stage { border-color: #e5e7eb; border-radius: 0.9rem; box-shadow: none; padding: 1.25rem; }
.step-panel-heading { gap: 0; }
.step-panel-number { display: none; }
.step-panel-heading h2 { font-size: 1.12rem; }
.step-panel-heading p { font-size: 0.78rem; }
.customer-choice-card, .form-section-card, .new-customer-fields { background: #fff; border-color: #e5e7eb; border-radius: 0.75rem; }
.customer-choice-card:focus-within, .form-section-card:focus-within { border-color: #bfdbfe; box-shadow: none; }
.choice-card-heading { border-bottom: 1px solid #f0f1f3; padding-bottom: 0.65rem; }
.choice-card-heading strong { font-size: 0.85rem; }
.customer-mode-toggle { background: #f3f4f6; border-radius: 0.65rem; display: inline-grid; gap: 0.2rem; grid-template-columns: repeat(2, auto); margin-bottom: 0.75rem; padding: 0.2rem; }
.customer-mode-toggle button { background: transparent; border-radius: 0.5rem; color: #6b7280; font-size: 0.78rem; min-height: 2.25rem; padding: 0.4rem 0.8rem; width: auto; }
.customer-mode-toggle button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgb(17 24 39 / 10%); color: #111827; font-weight: 700; }
.order-form-modern.is-enhanced .customer-choice-layout { grid-template-columns: 1fr; }
.new-customer-fields { margin-top: 0.75rem; }
.order-form-modern .confirmation-field { background: #f8fafc; border-color: #e5e7eb; color: #374151; }
.order-form-modern .sku-toolbar { background: #f7f7f8; }
.order-form-modern .sku-card { border-radius: 0.7rem; }
.order-form-modern .sku-card:hover { border-color: #93c5fd; box-shadow: none; transform: none; }
.order-form-modern .sku-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.sku-card-check { border-radius: 0.4rem; }
.sku-card-media { height: 82px; }
.sku-card-body { padding: 0.55rem 0.55rem 0.35rem; }
.sku-stock { padding: 0 0.55rem 0.55rem; }
.order-form-modern.is-enhanced .add-selected-button { display: none; }
.sku-direct-add-hint { color: #6b7280; display: none; font-size: 0.72rem; margin: 0.65rem 0 0; text-align: center; }
.order-form-modern.is-enhanced .sku-direct-add-hint { display: block; }
.order-form-modern .selected-skus { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.75rem; color: #111827; padding: 0.8rem; }
.selected-skus-heading { border-bottom-color: #e5e7eb; }
.selected-skus-heading h2 { color: #111827; }
.selected-skus-heading > span { background: #f3f4f6; color: #4b5563; }
.selected-sku-item { background: #f8fafc; border-color: #e5e7eb; }
.order-form-modern .selected-product-cell img, .order-form-modern .selected-thumb-placeholder { background: #e5e7eb; }
.order-form-modern .selected-product-cell strong { color: #111827; }
.order-form-modern .selected-product-cell small { color: #6b7280; }
.order-form-modern .quantity-control button { background: #e5e7eb; color: #111827; }
.order-form-modern .quantity-control input { color: #111827; }
.order-form-modern .sku-remove-button { color: #6b7280; }
.selected-stock { color: #9ca3af; }
.selected-empty { color: #9ca3af; }
.selected-empty > span { border-color: #d1d5db; }
.selected-empty strong { color: #6b7280; }
.order-amount-field { border-top-color: #e5e7eb; }
.order-form-modern .order-amount-field > label { color: #374151; }
.order-sync-note { background: #f0fdf4; border-radius: 0.65rem; color: #37734f; font-size: 0.78rem; margin: 0.75rem 0 0; padding: 0.7rem 0.8rem; }
.order-form-modern .order-form-actions { border-radius: 0.75rem; box-shadow: 0 8px 24px rgb(17 24 39 / 8%); }

@media (max-width: 639px) {
  .sales-order-hero { border-radius: 0; padding: 0.5rem 0 1rem; }
  .sales-order-operator { width: auto; }
  .order-form-stage { padding: 1rem 0.75rem; }
  .sku-card-media { height: 72px; }
}

/* Approved sales order canvas: compact order first, catalog on demand. */
.sales-order-page {
  --order-accent: #1f7455;
  --order-accent-dark: #175d44;
  --order-ink: #17231e;
  --order-muted: #6d7b74;
  --order-line: #e0e8e3;
  --order-soft: #f4f7f5;
  max-width: 1180px;
}
.sales-order-hero {
  align-items: center;
  background: transparent;
  border-radius: 0;
  color: var(--order-ink);
  display: flex;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 0.3rem 0;
}
.sales-order-heading { align-items: center; display: flex; gap: 1.2rem; }
.sales-order-heading > div { border-left: 1px solid #dce5e0; padding-left: 1.2rem; }
.sales-order-hero h1 { color: #17231e; font-size: clamp(1.45rem, 2.5vw, 1.9rem); margin: 0 0 0.2rem; }
.sales-order-hero p { color: #748078; font-size: 0.8rem; margin: 0; }
.sales-order-back { color: #53635b; font-size: 0.78rem; margin: 0; white-space: nowrap; }
.sales-order-operator { background: #edf5f1; border: 1px solid #d8e8df; border-radius: 0.65rem; color: #235e46; display: flex; gap: 0.45rem; padding: 0.5rem 0.7rem; }
.sales-order-operator span { color: #668074; font-size: 0.72rem; }
.sales-order-operator strong { color: #235e46; font-size: 0.75rem; margin: 0; }
.order-form-modern { color: var(--order-ink); }
.order-form-modern select,
.order-form-modern textarea,
.order-form-modern input:not([type="checkbox"]):not([type="hidden"]) {
  background: #fff;
  border: 1px solid #cedbd4;
  border-radius: 0.55rem;
  color: #1d2923;
  min-height: 2.55rem;
  padding: 0.6rem 0.7rem;
  width: 100%;
}
.order-form-modern textarea { min-height: 4.8rem; resize: vertical; }
.order-form-modern select:focus,
.order-form-modern textarea:focus,
.order-form-modern input:not([type="checkbox"]):not([type="hidden"]):focus { border-color: #1f7455; box-shadow: 0 0 0 3px rgb(31 116 85 / 12%); outline: 0; }
.order-form-modern .form-field { display: grid; gap: 0.38rem; margin: 0; min-width: 0; }
.order-form-modern .form-field > label,
.order-form-modern .contact-parser > label { color: #39483f; font-size: 0.76rem; font-weight: 700; }
.order-form-modern .form-hint { color: #7e8a84; font-size: 0.68rem; line-height: 1.45; }
.order-form-modern .field-requirement { border-radius: 999px; font-size: 0.62rem; font-weight: 700; padding: 0.2rem 0.4rem; }
.order-form-modern .field-requirement.required { background: #fff0f0; color: #b94242; }
.sales-order-canvas {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 19rem;
}
.sales-order-main { display: grid; gap: 1rem; min-width: 0; }
.order-form-modern fieldset { border: 0; margin: 0; min-width: 0; padding: 0; }
.order-form-modern fieldset > legend { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0 0 0 0); }
.order-work-panel,
.order-side-panel { background: #fff; border: 1px solid var(--order-line); border-radius: 0.85rem; }
.order-work-panel { padding: 1rem; }
.order-panel-heading,
.side-panel-heading { align-items: center; display: flex; gap: 1rem; justify-content: space-between; }
.order-panel-heading { border-bottom: 1px solid #edf1ef; margin: -0.1rem 0 0.9rem; padding: 0 0 0.8rem; }
.order-panel-heading h2,
.side-panel-heading h2 { color: #17231e; font-size: 0.95rem; margin: 0; }
.order-panel-heading p { color: #78847e; font-size: 0.72rem; margin: 0.25rem 0 0; }
.section-state { background: #edf7f2; border-radius: 999px; color: #2b6a4f; font-size: 0.64rem; font-weight: 700; padding: 0.25rem 0.48rem; white-space: nowrap; }
.optional-state { background: #f1f3f2; color: #748078; }
.catalog-open-button { background: #edf7f2; border: 1px solid #a8cfbd; border-radius: 0.55rem; color: #1b654a; flex: 0 0 auto; font-size: 0.78rem; font-weight: 750; min-height: 2.35rem; padding: 0.5rem 0.75rem; width: auto; }
.selected-sku-list { display: grid; }
.selected-sku-item { align-items: center; background: #fff; border: 0; border-bottom: 1px solid #edf1ef; border-radius: 0; display: grid; gap: 0.8rem; grid-template-columns: minmax(0, 1fr) auto; padding: 0.8rem 0; }
.selected-sku-item:last-child { border-bottom: 0; }
.selected-sku-item.has-error { background: #fff7f7; }
.selected-product-cell { align-items: center; display: flex; gap: 0.7rem; min-width: 0; }
.selected-product-cell img,
.selected-thumb-placeholder { background: #f1f3f2; border-radius: 0.55rem; flex: 0 0 auto; height: 3.3rem; object-fit: cover; width: 3.3rem; }
.selected-thumb-placeholder { align-items: center; color: #89948e; display: flex; font-size: 0.65rem; justify-content: center; }
.selected-product-cell > span { display: grid; min-width: 0; }
.selected-product-cell strong { color: #1d2923; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-product-cell small { color: #738078; font-size: 0.67rem; margin-top: 0.15rem; }
.selected-product-cell em { color: #2c7859; font-size: 0.65rem; font-style: normal; margin-top: 0.25rem; }
.selected-sku-controls { align-items: center; display: flex; gap: 0.45rem; }
.quantity-control { border: 1px solid #d5dfd9; border-radius: 0.5rem; display: grid; grid-template-columns: 2rem 4.25rem 2rem; overflow: hidden; }
.order-form-modern .quantity-control button { background: #f5f7f6; border: 0; border-radius: 0; color: #233029; min-height: 2rem; padding: 0; }
.order-form-modern .quantity-control input { appearance: textfield; background: #fff; border: 0; border-left: 1px solid #e4eae7; border-radius: 0; border-right: 1px solid #e4eae7; box-shadow: none; font-variant-numeric: tabular-nums; min-height: 2rem; min-width: 4.25rem; padding: 0.25rem 0.4rem; text-align: center; }
.order-form-modern .quantity-control input::-webkit-inner-spin-button,
.order-form-modern .quantity-control input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.order-edit-form { max-width: 960px; }
.order-edit-form .form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-edit-form .form-field { display: grid; gap: 0.4rem; min-width: 0; }
.order-edit-form .form-field.full-width { grid-column: 1 / -1; }
.order-edit-notice { align-items: center; background: #fff8e8; border: 1px solid #f2dfae; border-radius: 0.75rem; color: #70551d; display: grid; gap: 0.25rem; margin-top: 1rem; padding: 0.85rem 1rem; }
.order-edit-notice strong { font-size: 0.82rem; }
.order-edit-notice span { font-size: 0.72rem; }
.order-edit-notice a { font-size: 0.74rem; font-weight: 700; justify-self: start; }
@media (max-width: 720px) {
  .order-edit-form .form-grid { grid-template-columns: 1fr; }
  .order-edit-form .form-field.full-width { grid-column: auto; }
}
.order-form-modern .sku-remove-button { background: transparent; border: 0; color: #8a9690; font-size: 0.68rem; min-height: 2rem; padding: 0.3rem; width: auto; }
.selected-empty { align-items: center; color: #7d8983; display: flex; flex-direction: column; gap: 0.25rem; justify-content: center; min-height: 9rem; text-align: center; }
.selected-empty > span { align-items: center; border: 1px dashed #b9c7c0; border-radius: 50%; display: flex; font-size: 1.1rem; height: 2.4rem; justify-content: center; margin-bottom: 0.25rem; width: 2.4rem; }
.selected-empty strong { color: #536159; font-size: 0.8rem; }
.selected-empty small { font-size: 0.68rem; }
.order-items-footer { border-top: 1px solid #edf1ef; color: #68766f; display: flex; font-size: 0.7rem; gap: 1rem; justify-content: flex-end; padding-top: 0.7rem; }
.compact-form-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.evidence-field { grid-column: 1 / -1; }
.money-input { align-items: center; background: #fff; border: 1px solid #cedbd4; border-radius: 0.55rem; display: flex; overflow: hidden; }
.money-input > span { color: #617068; padding-left: 0.7rem; }
.order-form-modern .money-input input { border: 0 !important; box-shadow: none !important; }
.installment-panel { border-top: 1px solid #edf1ef; margin-top: 0.9rem; padding-top: 0.9rem; }
.plan-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0.65rem; }
.plan-row label { color: #39483f; display: grid; font-size: 0.72rem; font-weight: 700; gap: 0.35rem; }
.order-sync-note { background: #edf8f2; border-radius: 0.55rem; color: #32694f; font-size: 0.7rem; margin: 0.85rem 0 0; padding: 0.65rem 0.75rem; }
.order-summary-rail { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.order-side-panel { padding: 0.9rem; }
.side-panel-heading { border-bottom: 1px solid #edf1ef; margin-bottom: 0.75rem; padding-bottom: 0.7rem; }
.customer-mode-toggle { background: #f1f5f3; border-radius: 0.55rem; display: grid; gap: 0.2rem; grid-template-columns: repeat(2, 1fr); margin: 0 0 0.75rem; padding: 0.2rem; }
.customer-mode-toggle button { background: transparent; border: 0; border-radius: 0.4rem; color: #69766f; font-size: 0.72rem; min-height: 2rem; padding: 0.35rem; }
.customer-mode-toggle button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgb(23 35 30 / 10%); color: #1d2923; font-weight: 750; }
.existing-customer-picker { position: relative; }
.existing-customer-results { background: #fff; border: 1px solid #b9cec3; border-radius: 0.55rem; box-shadow: 0 10px 24px rgb(23 35 30 / 12%); display: grid; left: 0; max-height: 15rem; overflow-y: auto; position: absolute; right: 0; top: 4.35rem; z-index: 20; }
.existing-customer-results[hidden] { display: none; }
.existing-customer-results button { background: #fff; border: 0; border-bottom: 1px solid #edf1ef; border-radius: 0; color: #26342d; font-size: 0.74rem; justify-content: flex-start; min-height: 2.8rem; padding: 0.65rem 0.75rem; text-align: left; }
.existing-customer-results button:last-child { border-bottom: 0; }
.existing-customer-results button:hover,
.existing-customer-results button:focus-visible { background: #edf8f2; color: #176342; }
.existing-customer-empty { color: #7d8983; font-size: 0.72rem; margin: 0; padding: 0.8rem; }
.contact-parser { display: grid; gap: 0.45rem; }
.contact-parser textarea { margin: 0; }
.parse-contact-button { min-height: 2.25rem; width: 100%; }
.contact-parse-result { color: #597067; font-size: 0.66rem; min-height: 1rem; }
.contact-parse-result.has-issues,
.contact-field-issue { color: #b23c3c; font-size: 0.66rem; margin: 0; }
.new-customer-fields { display: grid; gap: 1rem; margin-top: 0.85rem; padding: 1rem; }
.customer-identity-fields { border-bottom: 1px solid #edf1ef; display: grid; gap: 0.85rem; padding-bottom: 1rem; }
.customer-address-field textarea { line-height: 1.55; min-height: 6.5rem; }
.customer-source-field { margin-top: 0.1rem !important; }
.frontline-promoter-field { background: #f7faf8; border: 1px solid #dfe8e3; border-radius: 0.55rem; padding: 0.7rem; }
.frontline-promoter-manual-label { color: #607068; font-size: 0.68rem; margin-top: 0.55rem; }
.confirmation-field { background: #f4f7f5; border: 1px solid #dfe8e3; border-radius: 0.55rem; color: #405048; font-size: 0.68rem; padding: 0.6rem; }
.confirmation-field label { align-items: flex-start; display: flex; gap: 0.45rem; }
.confirmation-field input { flex: 0 0 auto; margin-top: 0.1rem; }
.summary-row { color: #66736c; display: flex; font-size: 0.72rem; justify-content: space-between; padding: 0.28rem 0; }
.summary-row strong { color: #26342d; }
.summary-amount { border-top: 1px solid #edf1ef; margin-top: 0.55rem !important; padding-top: 0.75rem; }
.summary-total { align-items: end; border-top: 1px solid #edf1ef; display: flex; justify-content: space-between; margin-top: 0.75rem; padding-top: 0.75rem; }
.summary-total span { color: #5f6e66; font-size: 0.75rem; }
.summary-total strong { color: #173e2d; font-size: 1.25rem; }
.summary-actions { display: grid; gap: 0.5rem; grid-template-columns: 0.8fr 1.2fr; margin-top: 0.9rem; }
.summary-actions button { border-radius: 0.55rem; min-height: 2.65rem; padding: 0.55rem; }
.summary-actions [data-submit-order] { background: #1f7455; }
.summary-actions [data-submit-order]:hover { background: #175d44; }
.order-totals-panel > p { color: #849089; font-size: 0.65rem; line-height: 1.5; margin: 0.65rem 0 0; }
.catalog-drawer { background: #fff; border: 1px solid var(--order-line); border-radius: 0.85rem; margin-top: 1rem; overflow: hidden; }
.catalog-backdrop,
.catalog-close-button { display: none; }
.catalog-drawer-panel { background: #fff; }
.catalog-drawer-heading { align-items: center; border-bottom: 1px solid #e6ece8; display: flex; justify-content: space-between; padding: 1rem; }
.catalog-drawer-heading h2 { font-size: 1rem; margin: 0; }
.catalog-drawer-heading p { color: #77847d; font-size: 0.7rem; margin: 0.2rem 0 0; }
.sku-picker { padding: 1rem; }
.sku-toolbar { display: grid; gap: 0.65rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 0.8rem; }
.sku-toolbar label { color: #405048; display: grid; font-size: 0.7rem; font-weight: 700; gap: 0.35rem; }
.catalog-product-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0.1rem;
}
.catalog-category-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.85rem; }
.catalog-category-tabs button { background: #f1f5f3; border: 1px solid #dce5e0; border-radius: 999px; color: #526159; font-size: 0.68rem; min-height: 2rem; padding: 0.38rem 0.65rem; width: auto; }
.catalog-category-tabs button[aria-pressed="true"] { background: #1f7455; border-color: #1f7455; color: #fff; }
.catalog-category-tabs button span { font-size: 0.6rem; opacity: 0.78; }
.catalog-category-groups { display: grid; gap: 1rem; max-height: 29rem; overflow-y: auto; padding: 0.1rem 0.2rem 0.2rem 0.1rem; }
.catalog-category-group { border-top: 1px solid #e6ece8; padding-top: 0.75rem; }
.catalog-category-group:first-child { border-top: 0; padding-top: 0; }
.catalog-category-group > header { align-items: end; display: flex; justify-content: space-between; margin-bottom: 0.55rem; }
.catalog-category-group > header small { color: #728078; display: block; font-size: 0.59rem; }
.catalog-category-group > header h3 { color: #1d2923; font-size: 0.9rem; margin: 0.1rem 0 0; }
.catalog-category-group > header > span { color: #728078; font-size: 0.65rem; }
.sku-card { background: #fff; border: 1px solid #dce5e0; border-radius: 0.65rem; display: grid; gap: 0; overflow: hidden; padding: 0; position: relative; }
.sku-card:hover { border-color: #8ebda7; }
.sku-card.is-pending { border-color: #1f7455; box-shadow: 0 0 0 1px #1f7455; }
.sku-card.is-selected { background: #f4faf7; }
.sku-card.is-out-of-stock { opacity: 0.55; }
.sku-card-checkbox { height: 1px; opacity: 0; position: absolute; width: 1px; }
.sku-card-check { align-items: center; background: #fff; border: 1px solid #c7d3cd; border-radius: 50%; color: transparent; display: flex; font-size: 0.65rem; height: 1.25rem; justify-content: center; position: absolute; right: 0.45rem; top: 0.45rem; width: 1.25rem; z-index: 2; }
.sku-card.is-pending .sku-card-check { background: #1f7455; border-color: #1f7455; color: #fff; }
.catalog-product-media { height: 6.5rem; }
.catalog-product-media img,
.catalog-product-media .sku-card-placeholder { height: 100%; object-fit: cover; width: 100%; }
.catalog-product-media .sku-card-placeholder { align-items: center; background: #f2f5f3; color: #909b95; display: flex; font-size: 0.68rem; justify-content: center; }
.sku-card-body { display: grid; padding: 0.55rem 0.6rem 0.35rem; }
.sku-card-body strong { color: #233029; font-size: 0.73rem; line-height: 1.35; }
.sku-card-body span { color: #65736c; font-size: 0.65rem; margin-top: 0.2rem; }
.sku-card-body small { color: #909b95; font-size: 0.59rem; margin-top: 0.2rem; }
.sku-stock { color: #2a7657; font-size: 0.62rem; padding: 0 0.6rem 0.55rem; }
.sku-stock i { background: #3c9a73; border-radius: 50%; display: inline-block; height: 0.35rem; margin-right: 0.3rem; width: 0.35rem; }
.stock-danger { color: #b94242; }
.catalog-drawer-actions { align-items: center; background: #fff; border-top: 1px solid #e6ece8; display: flex; justify-content: space-between; margin: 0.85rem -1rem -1rem; padding: 0.75rem 1rem; }
.catalog-drawer-actions > span { color: #68766f; font-size: 0.7rem; }
.catalog-drawer-actions > div { display: flex; gap: 0.5rem; }
.catalog-drawer-actions button { min-height: 2.4rem; padding: 0.45rem 0.75rem; width: auto; }
.order-form-modern.is-enhanced .catalog-drawer-actions .add-selected-button { display: block; }
.order-form-modern.is-enhanced .catalog-drawer {
  align-items: stretch;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: none;
  inset: 0;
  margin: 0;
  position: fixed;
  z-index: 40;
}
.order-form-modern.is-enhanced .catalog-drawer.is-open { display: flex; }
.order-form-modern.is-enhanced .catalog-backdrop { background: rgb(14 25 19 / 42%); border: 0; display: block; inset: 0; padding: 0; position: absolute; width: 100%; }
.order-form-modern.is-enhanced .catalog-drawer-panel { box-shadow: -1rem 0 3rem rgb(18 31 24 / 18%); margin-left: auto; max-width: 46rem; overflow: auto; position: relative; width: min(76vw, 46rem); z-index: 1; }
.order-form-modern.is-enhanced .catalog-close-button { align-items: center; background: #f1f4f2; border: 0; border-radius: 0.5rem; color: #526159; display: flex; font-size: 1.25rem; height: 2rem; justify-content: center; padding: 0; width: 2rem; }
.catalog-drawer-open { overflow: hidden; }

@media (max-width: 900px) {
  .sales-order-canvas { grid-template-columns: minmax(0, 1fr) 16.5rem; }
  .catalog-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-form-grid { grid-template-columns: 1fr; }
  .evidence-field { grid-column: auto; }
}

@media (max-width: 639px) {
  .sales-order-page { margin-inline: -0.15rem; }
  .sales-order-hero { align-items: flex-start; padding: 0.25rem 0 0.75rem; }
  .sales-order-heading { align-items: flex-start; display: grid; gap: 0.5rem; }
  .sales-order-heading > div { border-left: 0; padding-left: 0; }
  .sales-order-hero p { max-width: 15rem; }
  .sales-order-operator { display: none; }
  .sales-order-canvas { display: flex; flex-direction: column; }
  .sales-order-main { display: contents; }
  .order-summary-rail { display: contents; position: static; }
  .customer-side-panel { order: 1; }
  .order-items-panel { order: 2; }
  .sales-order-main fieldset:nth-of-type(1) { display: contents; }
  .sales-order-main fieldset:nth-of-type(2) { order: 3; }
  .sales-order-main fieldset:nth-of-type(3) { order: 4; }
  .order-summary-rail fieldset { display: contents; }
  .order-totals-panel { order: 5; position: static; }
  .order-work-panel,
  .order-side-panel { border-radius: 0.75rem; padding: 0.8rem; width: 100%; }
  .sales-order-main fieldset { width: 100%; }
  .order-panel-heading { align-items: flex-start; }
  .order-panel-heading p { display: none; }
  .selected-sku-item { align-items: start; gap: 0.5rem; grid-template-columns: minmax(0, 1fr) auto; }
  .selected-product-cell img,
  .selected-thumb-placeholder { height: 2.8rem; width: 2.8rem; }
  .selected-sku-controls { align-items: end; flex-direction: column; }
  .catalog-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-product-media { height: 5.5rem; }
  .order-form-modern.is-enhanced .catalog-drawer-panel { height: 100%; width: 100%; }
  .sku-toolbar { grid-template-columns: 1fr; }
  .catalog-drawer-actions { bottom: 0; position: sticky; }
  .plan-row { grid-template-columns: 1fr; }
  .summary-actions { grid-template-columns: 1fr 1fr; }
}

/* Clear, reusable action forms for refunds, cancellations, reviews and warehouse follow-up. */
.stacked-form {
  display: grid;
  gap: 0.9rem;
}
.stacked-form > label,
.stacked-form > div > label,
.inline-actions label,
.finance-action-form label {
  color: #334155;
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.4rem;
  min-width: 0;
}
.stacked-form input:not([type="checkbox"]):not([type="hidden"]),
.stacked-form textarea,
.inline-actions input,
.inline-actions textarea,
.finance-action-form input,
.finance-action-form textarea,
.finance-action-form select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  box-sizing: border-box;
  font: inherit;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
}
.stacked-form textarea,
.inline-actions textarea,
.finance-action-form textarea { line-height: 1.5; resize: vertical; }
.stacked-form input:focus,
.stacked-form textarea:focus,
.inline-actions input:focus,
.inline-actions textarea:focus,
.finance-action-form input:focus,
.finance-action-form textarea:focus,
.finance-action-form select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);
  outline: 0;
}
.order-action-card { border: 1px solid #e2e8f0; box-shadow: 0 8px 24px rgb(15 23 42 / 5%); overflow: hidden; padding: 1.35rem; }
.order-action-heading { margin: 0 0 1rem; }
.order-action-amount { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; color: #64748b; font-size: 0.78rem; padding: 0.45rem 0.7rem; white-space: nowrap; }
.order-action-amount strong { color: #172033; font-size: 0.95rem; margin-left: 0.2rem; }
.action-disclosure { border: 1px solid #dbe3ed; border-radius: 0.8rem; overflow: hidden; }
.action-disclosure > summary { align-items: center; background: #f8fafc; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 0.9rem 1rem; }
.action-disclosure > summary::-webkit-details-marker { display: none; }
.action-disclosure > summary span { display: grid; gap: 0.18rem; }
.action-disclosure > summary strong { color: #172033; font-size: 0.95rem; }
.action-disclosure > summary small { color: #64748b; font-size: 0.72rem; font-weight: 500; }
.action-disclosure > summary b { color: #1d4ed8; font-size: 0.75rem; }
.action-disclosure[open] > summary { border-bottom: 1px solid #dbe3ed; }
.action-disclosure[open] > summary b::before { content: "收起 · "; }
.action-disclosure[open] > summary b { font-size: 0; }
.action-disclosure[open] > summary b::before { font-size: 0.75rem; }
.action-form { background: #fff; gap: 1rem; grid-template-columns: minmax(12rem, 0.72fr) minmax(18rem, 1.28fr); padding: 1rem; }
.action-field { align-content: start; display: grid; gap: 0.42rem; min-width: 0; }
.action-field > span { color: #334155; font-size: 0.78rem; font-weight: 750; }
.action-field-wide { grid-column: 1 / -1; }
.action-form input,
.action-form textarea { margin: 0; }
.money-field { align-items: center; background: #fff; border: 1px solid #cbd5e1; border-radius: 0.6rem; display: flex; overflow: hidden; }
.money-field:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.money-field i { color: #64748b; font-style: normal; padding-left: 0.75rem; }
.money-field input { border: 0 !important; box-shadow: none !important; min-width: 0; }
.action-form-footer { align-items: center; border-top: 1px solid #eef2f7; display: flex; gap: 1rem; grid-column: 1 / -1; justify-content: space-between; padding-top: 1rem; }
.action-form-footer .form-hint { line-height: 1.55; margin: 0; max-width: 48rem; }
.action-form-footer button { flex: 0 0 auto; min-width: 10rem; width: auto; }
.cancellation-disclosure > summary { background: #fffbeb; }
.single-action-form { grid-template-columns: 1fr; }
.action-progress-panel { background: #f8fafc; border: 1px solid #dbe3ed; border-radius: 0.8rem; padding: 1rem; }
.action-progress-panel > div:first-child { align-items: center; display: flex; gap: 0.65rem; }
.action-progress-panel dl,
.review-request-info dl { display: grid; gap: 0.65rem; margin: 0.9rem 0 0; }
.action-progress-panel dl > div,
.review-request-info dl > div { display: grid; gap: 0.15rem; grid-template-columns: 6.5rem minmax(0, 1fr); }
.action-progress-panel dt,
.review-request-info dt { color: #64748b; font-size: 0.74rem; }
.action-progress-panel dd,
.review-request-info dd { color: #273449; font-size: 0.82rem; margin: 0; overflow-wrap: anywhere; }
.action-progress-panel > a { margin-top: 0.9rem; }
.action-review-section { padding: 1.25rem; }
.action-review-section > .section-heading { margin-top: 0; }
.review-count { background: #eff6ff; border-radius: 999px; color: #1d4ed8; font-size: 0.75rem; font-weight: 750; padding: 0.4rem 0.65rem; }
.warehouse-order-card.action-review-card { align-items: stretch; background: #f8fafc; border: 1px solid #dbe3ed; border-radius: 0.85rem; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.8fr); margin-top: 0.75rem; padding: 1rem; }
.review-request-info { min-width: 0; }
.review-request-info > p { color: #64748b; font-size: 0.78rem; margin: 0.3rem 0 0; }
.review-request-title { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; }
.review-request-title strong { color: #172033; overflow-wrap: anywhere; }
.review-request-title b { color: #b45309; font-size: 1.05rem; white-space: nowrap; }
.inline-actions.decision-form { align-content: center; border-left: 1px solid #dbe3ed; display: grid; gap: 0.75rem; padding-left: 1rem; }
.decision-buttons { display: grid; gap: 0.55rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.decision-buttons button { min-height: 2.5rem; padding: 0.5rem 0.65rem; }
.decision-buttons .secondary-button { border: 0; cursor: pointer; }
.refund-finance-list { display: grid; gap: 0.75rem; padding: 1.25rem; }
.refund-finance-list .action-review-card { margin-top: 0; }
.refund-proof-form { align-content: center; background: #fff; border-left: 1px solid #dbe3ed; border-radius: 0.65rem; padding: 0.9rem; }
.refund-proof-form label span { display: block; }
.refund-proof-form .form-hint { font-size: 0.72rem; line-height: 1.45; margin: 0; }
.refund-proof-form button { width: 100%; }
.inline-actions:not(.decision-form) { align-items: end; display: grid; gap: 0.55rem; grid-template-columns: minmax(12rem, 1fr) repeat(2, minmax(7rem, auto)); }
.inline-actions:not(.decision-form) button { min-height: 2.55rem; padding: 0.5rem 0.65rem; width: auto; }

@media (max-width: 820px) {
  .action-form,
  .warehouse-order-card.action-review-card { grid-template-columns: 1fr; }
  .inline-actions.decision-form,
  .refund-proof-form { border-left: 0; border-top: 1px solid #dbe3ed; padding-left: 0; padding-top: 1rem; }
  .inline-actions:not(.decision-form) { grid-template-columns: 1fr 1fr; }
  .inline-actions:not(.decision-form) label { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .order-action-card,
  .action-review-section,
  .refund-finance-list { padding: 1rem; }
  .order-action-heading { align-items: flex-start; }
  .order-action-amount { white-space: normal; }
  .action-disclosure > summary { align-items: flex-start; gap: 0.75rem; }
  .action-form { padding: 0.85rem; }
  .action-form-footer { align-items: stretch; flex-direction: column; }
  .action-form-footer button { width: 100%; }
  .action-progress-panel dl > div,
  .review-request-info dl > div { grid-template-columns: 1fr; }
  .decision-buttons,
  .inline-actions:not(.decision-form) { grid-template-columns: 1fr; }
  .inline-actions:not(.decision-form) label { grid-column: auto; }
}
.pagination { align-items: center; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin: 1rem 0; }
.pagination a { border: 1px solid #cfddf8; border-radius: 0.5rem; padding: 0.45rem 0.85rem; text-decoration: none; }
.pagination span { color: #4a5d75; font-size: 0.9rem; }
.owner-todo-grid { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.owner-todo-grid a.owner-todo-approval { background: #eef4ff; border-color: #bfd3fb; }
.sales-task-payment-return { border-color: #fcd34d; background: #fffbeb; }
.payment-return-card.is-open { border-left: 4px solid #f59e0b; }
.payment-return-reason { white-space: pre-wrap; }
.payment-return-reply-form { display: grid; gap: .5rem; max-width: 36rem; }
.refund-group h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.refund-group + .refund-group { margin-top: 1rem; }
.refund-history > summary { cursor: pointer; font-weight: 700; padding: .5rem 0; }
.sales-outcome-list { border: 1px solid #e2e8f0; border-radius: .9rem; display: grid; gap: .4rem; padding: .8rem; }
.sales-outcome-list h3 { font-size: .95rem; margin: 0 0 .2rem; }
.sales-outcome-row { align-items: center; border-left: 4px solid #94a3b8; border-radius: .5rem; color: inherit; display: flex; gap: .75rem; justify-content: space-between; padding: .45rem .7rem; text-decoration: none; }
.sales-outcome-row span { display: grid; gap: .15rem; }
.sales-outcome-row small { color: #64748b; }
.sales-outcome-row.is-success { border-left-color: #16a34a; background: #f0fdf4; }
.sales-outcome-row.is-danger { border-left-color: #dc2626; background: #fef2f2; }

/* 2026-10-17: sales refund proof on cancellation requests */
.cancellation-refund-proof { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 12px 14px; margin: 4px 0 8px; display: grid; gap: 8px; }
.cancellation-refund-proof legend { font-weight: 600; padding: 0 4px; }
.cancellation-refund-toggle { display: flex; align-items: center; gap: 8px; }
.cancellation-refund-proof-summary { background: #f0f7ff; border: 1px solid #cfe3ff; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.cancellation-refund-proof-summary h5 { margin: 0 0 4px; }
.cancellation-refund-proof-summary p { margin: 0; overflow-wrap: anywhere; }

/* 2026-10-17: daily fan intake */
.sales-fan-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; align-items: end; }
.sales-fan-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted, #64748b); }
.sales-fan-form input { width: 100%; }
.sales-fan-month { font-size: 13px; color: var(--muted, #64748b); }
.sales-fan-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 0; }
.sales-fan-metrics div { background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.sales-fan-metrics dt { font-size: 12px; color: var(--muted, #64748b); }
.sales-fan-metrics dd { margin: 2px 0 0; font-weight: 600; }
.fan-table td, .fan-table th { white-space: nowrap; }
.fan-missing { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 10px 12px; }
.customer-new-fields { display: contents; }
.customer-new-fields[hidden] { display: none; }
.sales-manager-fan-card .fan-missing { margin: 10px 0 0; }
.sales-manager-fan-card .table-wrap { margin-top: 12px; }
.list-fold { border: 1px solid #e2e8f0; border-radius: .85rem; background: #fff; }
.list-fold > summary { align-items: center; cursor: pointer; display: flex; gap: .8rem; justify-content: space-between; list-style: none; padding: .75rem .9rem; }
.list-fold > summary::-webkit-details-marker { display: none; }
.list-fold > summary span strong, .list-fold > summary span small { display: block; }
.list-fold > summary small { color: #64748b; font-size: .75rem; margin-top: .15rem; }
.list-fold-toggle { color: #1d4ed8; font-size: .8rem; white-space: nowrap; }
.list-fold-toggle::after { content: "展开"; }
.list-fold[open] > summary .list-fold-toggle::after { content: "收起"; }
.list-fold[open] > summary { border-bottom: 1px solid #e2e8f0; }
.list-fold > :not(summary) { margin: .8rem; }
.sales-outcome-list.list-fold { padding: 0; }
/* Tables: top-aligned cells, quiet text links, stacked cell content. */
th, td { vertical-align: top; }
td a { color: #1d4ed8; font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
td a.is-danger { color: #b91c1c; }
.order-no { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-stack { display: flex; flex-direction: column; gap: 0.25rem; }
.cell-stack small { color: #64748b; font-size: 0.78rem; }
.cell-actions { align-items: flex-start; display: flex; flex-direction: column; gap: 0.4rem; white-space: nowrap; }
.tracking-line { align-items: center; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.finance-amount-stack { white-space: nowrap; }
.nowrap { white-space: nowrap; }
/* Quiet text links. */
.finance-dashboard-footer a, .owner-dashboard-footer a { text-decoration: none; }
.finance-dashboard-footer a:hover, .owner-dashboard-footer a:hover { text-decoration: underline; }
.section-heading a:not([class]) { color: #1d4ed8; font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.section-heading a:not([class]):hover { text-decoration: underline; }
.wallet-form > a:not([class]) { align-self: center; color: #1d4ed8; font-weight: 700; text-decoration: none; white-space: nowrap; }
button + .form-hint, form > .form-hint:last-child { margin-top: 0.6rem; }
.workspace-heading > a:not([class]) { align-self: auto; color: #1d4ed8; font-size: 0.85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workspace-heading > a:not([class]):hover { text-decoration: underline; }
.sales-fan-metrics div { display: flex; flex-direction: column; justify-content: space-between; }
.reconciliation-table-heading a { color: #1d4ed8; font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.reconciliation-table-heading a:hover { text-decoration: underline; }
@media (max-width: 639px) {
  .owner-bar-column:nth-child(even) small { visibility: hidden; }
}
select { background: #fff; border: 1px solid #cbd5e1; border-radius: 0.6rem; color: inherit; font: inherit; min-height: 2.75rem; padding: 0.55rem 0.75rem; }
/* Ten-per-page lists (static/js/list-pager.js). */
[data-paginate] > [hidden], [data-paginate] > tbody > tr[hidden] { display: none !important; }
.list-pager { align-items: center; display: flex; gap: 0.6rem; justify-content: center; margin: 0.8rem 0 0.2rem; }
.list-pager span { color: #64748b; font-size: 0.8rem; white-space: nowrap; }
.list-pager button { background: #fff; border: 1px solid #cbd5e1; border-radius: 0.5rem; color: #1d4ed8; font-size: 0.8rem; font-weight: 700; min-height: 2.2rem; padding: 0.3rem 0.8rem; width: auto; }
.list-pager button:disabled { color: #94a3b8; cursor: default; }
.tracking-line { flex-wrap: nowrap; justify-content: space-between; gap: 0.8rem; }
.tracking-line > span { white-space: nowrap; }
.refund-cancellation-hint { align-items: center; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; display: flex; gap: 1rem; justify-content: space-between; text-decoration: none; }
.refund-cancellation-hint span strong, .refund-cancellation-hint span small { display: block; }
.refund-cancellation-hint small { color: #9a3412; font-size: 0.8rem; margin-top: 0.25rem; }
.refund-cancellation-hint b { color: #1d4ed8; font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 639px) { .refund-cancellation-hint { align-items: flex-start; flex-direction: column; } }
/* Finance: review tabs in two groups, sub-tabs under 工资 / 利润. */
.review-tab-groups { border-bottom: 1px solid #e2e8f0; margin-bottom: 1rem; padding-bottom: 0.6rem; }
.review-tab-groups .workspace-filter-tabs { align-items: center; border-bottom: 0; margin-bottom: 0.35rem; padding-bottom: 0; }
.review-tab-group-label { color: #64748b; font-size: 0.75rem; font-weight: 700; min-width: 3rem; }
.finance-subtabs { border-bottom: 0; margin: -0.4rem 0 1rem; padding-bottom: 0; }
.approval-finance-pointer a { color: #1d4ed8; font-weight: 700; }
.overdue-note { color: #b91c1c; font-weight: 700; }
.sales-status-summary a { background: #fff; border: 1px solid #dbe5f2; border-radius: 1rem; color: inherit; display: grid; gap: 0.2rem; padding: 0.85rem 1rem; text-decoration: none; }
.sales-status-summary a:hover { border-color: #93c5fd; }
.sales-status-summary a span { color: #52627a; font-size: 0.78rem; font-weight: 700; }
.sales-status-summary a strong { font-size: 1.6rem; }
.sales-status-summary a small { color: #718096; font-size: 0.68rem; }
@media (max-width: 639px) { .sales-status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sales-goal-metrics { margin-top: 0.9rem; padding-inline: 0; }
.sales-payment-review-link { color: #1d4ed8; display: inline-block; font-size: 0.82rem; font-weight: 700; margin-top: 0.8rem; text-decoration: none; }
.sales-payment-review-link:hover { text-decoration: underline; }
.warehouse-reminder-note { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 0.75rem; color: #9a3412; font-size: 0.85rem; font-weight: 700; margin: -0.25rem 0 1rem; padding: 0.6rem 0.85rem; }
.owner-future-note { color: #64748b; font-size: 0.82rem; margin: 0.8rem 0 0; }
.owner-future-note a { color: #1d4ed8; font-weight: 700; text-decoration: none; }
@media (max-width: 639px) { .warehouse-priority-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
