:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-2: #eef3f2;
  --ink: #18201f;
  --muted: #61706d;
  --line: #d7dfdc;
  --primary: #126b5f;
  --primary-strong: #0b5349;
  --accent: #2456a6;
  --warn: #986a12;
  --danger: #b9332b;
  --good: #1f7a43;
  --shadow: 0 12px 30px rgba(15, 30, 35, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  padding: 0;
}

.login-panel h1 {
  font-size: 22px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.label-caption {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.required-star {
  color: var(--danger);
  font-weight: 800;
}

.password-input {
  position: relative;
  display: block;
}

.password-input input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 56px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 6px;
  background: #eef3f2;
  color: var(--primary);
  font-size: 12px;
}

.password-toggle:hover {
  border-color: var(--line);
  background: #ffffff;
}

.login-error {
  color: var(--danger);
}

.app-shell[hidden],
.login-view[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #162321;
  color: #edf5f2;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

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

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

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

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  color: #d8e5e1;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: #24413b;
  border-color: #375e56;
  color: #ffffff;
}

.store-box {
  margin-top: auto;
  padding: 12px;
  border: 1px solid #37514b;
  border-radius: 8px;
  background: #1d302c;
}

.store-box span,
.store-box strong {
  display: block;
}

.store-box small {
  display: block;
  margin-top: 6px;
  color: #d5e0dd;
  font-size: 12px;
  line-height: 1.35;
}

.store-box small.danger {
  color: #ffd0cc;
}

.store-box span {
  color: #afbfbb;
  font-size: 12px;
}

.store-box select {
  margin-top: 10px;
  border-color: #37514b;
  background: #162321;
  color: #edf5f2;
}

.main-panel {
  min-width: 0;
  max-width: 100%;
  padding: 20px;
}

.view,
.work-panel,
.table-wrap,
.filter-bar,
.topbar,
.top-actions {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
}

.top-actions,
.inline-actions,
.filter-bar,
.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.file-picker input {
  max-width: 260px;
  font: inherit;
}

.lang-switch {
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f2;
}

.lang-btn {
  min-width: 54px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 30, 35, 0.08);
}

.user-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
}

.store-id-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #bdd8d0;
  border-radius: 999px;
  background: #edf8f5;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.version-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #ccd7d4;
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.top-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.online-order-alert {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #f0c060;
  border-radius: 999px;
  background: #fff5df;
  color: #875400;
  font-weight: 800;
  white-space: nowrap;
}

.online-order-alert:hover {
  border-color: #d99a1e;
  background: #ffe8af;
}

.inline-actions.end {
  justify-content: flex-end;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.btn:hover {
  border-color: #9cafaa;
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.2);
}

.btn:disabled:hover,
.btn[disabled]:hover {
  border-color: var(--line);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.status-bar {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #bdd3ce;
  border-radius: 8px;
  background: #edf8f5;
  color: #174f45;
}

.status-bar.error {
  border-color: #efbbb7;
  background: #fff0ef;
  color: #8e251e;
}

.version-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e3c16b;
  border-radius: 8px;
  background: #fff8e6;
  color: #654300;
}

.version-update-banner strong,
.version-update-banner p {
  display: block;
}

.version-update-banner p {
  margin-top: 3px;
  color: #7a5a12;
}

.version-update-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.system-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #d49b25;
  border-radius: 8px;
  background: #fff4d6;
  color: #5f3b00;
}

.system-status-banner.critical {
  border-color: #cb3b32;
  background: #fff0ef;
  color: #8e251e;
}

.system-status-banner strong,
.system-status-banner p {
  display: block;
}

.system-status-banner p {
  margin-top: 3px;
  color: inherit;
}

.update-protection-box {
  padding: 12px;
  border: 1px solid #d6e2dc;
  border-radius: 8px;
  background: #f4fbf8;
  color: #24483d;
}

.update-protection-box strong {
  display: block;
  margin-bottom: 6px;
}

.update-checklist {
  margin: 0;
  padding-left: 18px;
  color: #31594d;
}

.update-checklist li + li {
  margin-top: 4px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric-tile {
  min-width: 0;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.metric-tile span,
.metric-tile strong {
  display: block;
}

.metric-tile span {
  color: var(--muted);
}

.metric-tile strong {
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.15;
  max-width: 100%;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.metric-tile.warn strong {
  color: var(--warn);
}

.metric-tile.danger strong {
  color: var(--danger);
}

.system-status-tile {
  position: relative;
}

.system-status-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.system-status-tile button {
  margin-top: 10px;
}

.system-status-tile.warn {
  border-color: rgba(180, 110, 0, 0.34);
  background: #fff8e8;
}

.system-status-tile.danger {
  border-color: rgba(183, 28, 28, 0.34);
  background: #fff2f2;
}

.split-layout,
.sale-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 14px;
}

.sale-grid {
  grid-template-columns: minmax(320px, 0.75fr) minmax(460px, 1.25fr);
}

.work-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.connection-hint {
  min-height: 38px;
  margin: -2px 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  line-height: 1.35;
}

.connection-hint.good {
  border-color: #b9dccf;
  background: #ecf9f3;
  color: var(--primary);
}

.connection-hint.warn {
  border-color: #f0d59b;
  background: #fff8e7;
  color: #7a5200;
}

.panel-title-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.product-count-badge {
  min-height: 28px;
  padding: 0 10px;
  background: #eaf7ef;
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.quotation-scope-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 8px;
}

.quotation-scope-tab {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.quotation-scope-tab:hover,
.quotation-scope-tab.active {
  border-color: #91c7bc;
  background: #eaf7f3;
  color: var(--primary);
}

.quotation-scope-tab strong {
  min-width: 34px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff3d2;
  color: #8a5a00;
  font-size: 15px;
}

.quotation-scope-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.quotation-status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.quotation-status-card {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quotation-status-card:hover,
.quotation-status-card.active {
  border-color: #9fcfc4;
  background: #f0fbf8;
}

.quotation-status-card.warn.active,
.quotation-status-card.warn:hover {
  border-color: #f0d59b;
  background: #fff8e7;
}

.quotation-status-card.good.active,
.quotation-status-card.good:hover {
  border-color: #b9dccf;
  background: #ecf9f3;
}

.quotation-status-card.danger.active,
.quotation-status-card.danger:hover {
  border-color: #f0b6b1;
  background: #fff1f0;
}

.quotation-status-card span {
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.quotation-status-card strong {
  font-size: 24px;
  line-height: 1;
}

.fuel-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.fuel-layout {
  margin-bottom: 14px;
}

#fuelView.use-workstation > :not(.fuel-workstation-shell) {
  display: none;
}

.fuel-workstation-shell {
  height: calc(100vh - 130px);
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.fuel-workstation-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #f2f7f5;
}

.fuel-panel + .fuel-panel {
  margin-top: 14px;
}

.fuel-report-metrics {
  margin-bottom: 14px;
}

.fuel-shift-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.fuel-shift-summary > div {
  min-width: 0;
  min-height: 82px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

.fuel-shift-summary span {
  color: var(--muted);
}

.fuel-shift-summary strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.fuel-external-hint {
  margin: -2px 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.fuel-action-list,
.fuel-progress-list {
  display: grid;
  gap: 8px;
}

.fuel-action-row,
.fuel-progress-list > div {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  text-decoration: none;
  color: var(--ink);
}

.fuel-action-row:hover {
  border-color: #9cafaa;
  background: #ffffff;
}

.fuel-action-row span,
.fuel-progress-list span {
  color: var(--muted);
}

.fuel-action-row strong,
.fuel-progress-list strong {
  color: var(--primary);
  white-space: nowrap;
}

.quiet {
  color: var(--muted);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.import-result {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.report-section-title {
  margin: 18px 0 10px;
  font-size: 20px;
}

#reportProductActivityTableElement {
  min-width: 0;
}

#reportProductActivityTableElement td:nth-child(2),
#reportProductActivityTableElement td:nth-child(4) {
  white-space: normal;
}

.change-list {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.change-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.change-preview-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.activity-detail-btn {
  justify-self: start;
  min-height: 34px;
  min-width: 62px;
  padding: 0 10px;
}

.activity-operator {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.activity-detail-section .change-list {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

.customer-history-head strong,
.customer-history-head span {
  display: block;
}

.customer-history-head span {
  color: var(--muted);
}

.customer-history-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.customer-history-summary div {
  min-width: 0;
  min-height: 78px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

.customer-history-summary span {
  color: var(--muted);
}

.customer-history-summary strong {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
}

.section-title-row h3 {
  margin: 0;
}

.quotation-reminder-history {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.quotation-reminder-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quotation-reminder-line .badge {
  min-height: 22px;
  padding: 0 7px;
  font-size: 12px;
}

.quotation-action-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quotation-action-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.quotation-action-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quotation-action-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.quotation-action-group .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
}

.quotation-action-group.danger-zone {
  border-color: rgba(185, 51, 43, 0.28);
  background: #fff6f5;
}

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

.reminder-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.reminder-row span,
.reminder-row small {
  color: var(--muted);
}

.reminder-row strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.danger-text {
  color: var(--danger) !important;
}

.customer-history-download {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.customer-history-download label {
  margin: 0;
}

.customer-history-download .btn {
  min-height: 48px;
}

.customer-history-section h3 {
  margin: 6px 0 10px;
  font-size: 18px;
}

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

.customer-history-table th,
.customer-history-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.modal-fit-wrap {
  overflow-x: hidden;
}

.customer-history-table th,
.customer-history-table td {
  padding: 8px;
  font-size: 14px;
}

.customer-history-table .btn {
  min-width: 0;
  padding-inline: 8px;
}

.customer-history-table input {
  min-width: 0;
}

.history-orders-table th:nth-child(1),
.history-orders-table td:nth-child(1) {
  width: 16%;
}

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

.history-orders-table th:nth-child(3),
.history-orders-table td:nth-child(3) {
  width: 22%;
}

.history-orders-table th:nth-child(4),
.history-orders-table td:nth-child(4),
.history-orders-table th:nth-child(5),
.history-orders-table td:nth-child(5),
.history-orders-table th:nth-child(6),
.history-orders-table td:nth-child(6) {
  width: 11%;
}

.history-orders-table th:nth-child(7),
.history-orders-table td:nth-child(7) {
  width: 8%;
}

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

.history-payments-table th:nth-child(1),
.history-payments-table td:nth-child(1) {
  width: 17%;
}

.history-payments-table th:nth-child(2),
.history-payments-table td:nth-child(2) {
  width: 16%;
}

.history-payments-table th:nth-child(3),
.history-payments-table td:nth-child(3) {
  width: 12%;
}

.history-payments-table th:nth-child(4),
.history-payments-table td:nth-child(4) {
  width: 10%;
}

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

.history-payments-table th:nth-child(6),
.history-payments-table td:nth-child(6) {
  width: 13%;
}

.history-payments-table th:nth-child(7),
.history-payments-table td:nth-child(7) {
  width: 12%;
}

.history-points-table th:nth-child(1),
.history-points-table td:nth-child(1) {
  width: 15%;
}

.history-points-table th:nth-child(2),
.history-points-table td:nth-child(2) {
  width: 12%;
}

.history-points-table th:nth-child(3),
.history-points-table td:nth-child(3),
.history-points-table th:nth-child(4),
.history-points-table td:nth-child(4),
.history-points-table th:nth-child(5),
.history-points-table td:nth-child(5) {
  width: 10%;
}

.history-points-table th:nth-child(6),
.history-points-table td:nth-child(6) {
  width: 12%;
}

.history-points-table th:nth-child(7),
.history-points-table td:nth-child(7) {
  width: 17%;
}

.history-points-table th:nth-child(8),
.history-points-table td:nth-child(8) {
  width: 14%;
}

.quotation-detail-table th:nth-child(1),
.quotation-detail-table td:nth-child(1) {
  width: 38%;
}

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

.quotation-detail-table th:nth-child(3),
.quotation-detail-table td:nth-child(3),
.quotation-detail-table th:nth-child(4),
.quotation-detail-table td:nth-child(4) {
  width: 17%;
}

.quotation-detail-table th:nth-child(5),
.quotation-detail-table td:nth-child(5) {
  width: 14%;
}

.quotation-detail-table .btn {
  width: 100%;
}

.transfer-detail-table th:nth-child(1),
.transfer-detail-table td:nth-child(1) {
  width: 8%;
}

.transfer-detail-table th:nth-child(2),
.transfer-detail-table td:nth-child(2) {
  width: 13%;
}

.transfer-detail-table th:nth-child(3),
.transfer-detail-table td:nth-child(3) {
  width: 25%;
}

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

.transfer-detail-table th:nth-child(5),
.transfer-detail-table td:nth-child(5) {
  width: 9%;
}

.transfer-detail-table th:nth-child(6),
.transfer-detail-table td:nth-child(6),
.transfer-detail-table th:nth-child(7),
.transfer-detail-table td:nth-child(7),
.transfer-detail-table th:nth-child(8),
.transfer-detail-table td:nth-child(8) {
  width: 11%;
}

.transfer-detail-table .product-thumb {
  width: 44px;
  height: 44px;
}

.customer-history-items {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customer-history-items strong,
.customer-history-items span {
  display: block;
}

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

#quotationEditTotals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

#quotationEditTotals div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

#quotationEditTotals span,
#quotationEditTotals strong {
  display: block;
}

#quotationEditTotals span {
  color: var(--muted);
}

#quotationEditTotals strong {
  margin-top: 6px;
  font-size: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap > table {
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

th,
td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  color: var(--muted);
  background: #f2f5f4;
  font-weight: 600;
}

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

.product-table td:nth-child(3),
.cart-table td:nth-child(1) {
  white-space: normal;
  min-width: 0;
}

.cart-table {
  overflow-x: hidden;
}

.cart-table table {
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.cart-table th,
.cart-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cart-table td:nth-child(1) {
  min-width: 0;
}

.sale-cart-table th:nth-child(1),
.sale-cart-table td:nth-child(1) {
  width: 44%;
}

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

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

.sale-cart-table th:nth-child(5),
.sale-cart-table td:nth-child(5) {
  width: 12%;
}

.sale-cart-table .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
}

.transfer-items-table th:nth-child(1),
.transfer-items-table td:nth-child(1) {
  width: 33%;
}

.transfer-items-table th:nth-child(2),
.transfer-items-table td:nth-child(2) {
  width: 12%;
}

.transfer-items-table th:nth-child(3),
.transfer-items-table td:nth-child(3) {
  width: 12%;
}

.transfer-items-table th:nth-child(4),
.transfer-items-table td:nth-child(4) {
  width: 17%;
}

.transfer-items-table th:nth-child(5),
.transfer-items-table td:nth-child(5) {
  width: 17%;
}

.transfer-items-table th:nth-child(6),
.transfer-items-table td:nth-child(6) {
  width: 9%;
}

.transfer-items-table th,
.transfer-items-table td {
  padding-inline: 8px;
}

.transfer-items-table .transfer-price-input {
  min-width: 0;
  padding-inline: 8px;
}

.transfer-items-table .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
}

.transfer-items-table .remove-line-btn {
  min-height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.product-table {
  overflow-x: hidden;
}

.product-table table {
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

.product-table th,
.product-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
  width: 72px;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
  width: 108px;
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
  width: auto;
  min-width: 0;
}

.product-table th:nth-child(4),
.product-table td:nth-child(4) {
  width: 72px;
  text-align: center;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5),
.product-table th:nth-child(6),
.product-table td:nth-child(6) {
  width: 104px;
}

.product-table th:nth-child(7),
.product-table td:nth-child(7) {
  width: 120px;
}

.product-table th:nth-child(8),
.product-table td:nth-child(8) {
  width: 96px;
}

.product-table .inline-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
  gap: 6px;
}

.product-table .inline-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
}

.quotation-table-wrap {
  overflow-x: auto;
}

.quotation-table {
  min-width: 1080px;
  max-width: 100%;
  table-layout: fixed;
}

.quotation-table th,
.quotation-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

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

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

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

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

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

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

.quotation-table .inline-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
  gap: 6px;
  min-width: 220px;
}

.quotation-table .inline-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quotation-actions-cell {
  align-content: start;
}

.quotation-cancellation-line {
  margin-top: 6px;
  color: #9f1f1f;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quotation-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.quotation-primary-actions:has(.quotation-action-note) {
  grid-template-columns: minmax(78px, 0.75fr) minmax(120px, 1.25fr);
}

.quotation-action-note {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  text-align: center;
  overflow-wrap: anywhere;
}

.quotation-print-menu {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.quotation-print-menu > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--primary);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quotation-print-menu > summary::-webkit-details-marker {
  display: none;
}

.quotation-print-menu[open] {
  padding: 0 6px 6px;
}

.quotation-print-menu[open] > summary {
  margin: 0 -6px 6px;
  border-bottom: 1px solid var(--line);
}

.quotation-print-menu .btn + .btn {
  margin-top: 6px;
}

.quotation-print-menu .btn {
  min-height: 38px;
  white-space: normal;
}

.quotation-danger-actions .btn {
  border-color: rgba(185, 51, 43, 0.52);
}

.fit-table-wrap {
  overflow-x: hidden;
}

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

.fit-table th,
.fit-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.fit-table .inline-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fit-table .inline-actions .btn,
.fit-table td > .btn {
  min-width: 64px;
  padding-inline: 10px;
}

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

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

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

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

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

.customers-table th:nth-child(1),
.customers-table td:nth-child(1) {
  width: 32%;
}

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

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

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

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
  width: 17%;
}

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

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

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

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

.orders-table .order-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.contact-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.contact-stack a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customers-table .inline-actions.right {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  justify-content: stretch;
  gap: 6px;
}

.members-table .inline-actions.right {
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, 1fr));
  justify-content: stretch;
  gap: 6px;
}

.customers-table .inline-actions .btn,
.members-table .inline-actions .btn,
.orders-table td:nth-child(7) .btn {
  width: 100%;
  min-width: 0;
}

.order-detail-table th:nth-child(1),
.order-detail-table td:nth-child(1) {
  width: 52%;
}

.order-detail-table th:nth-child(2),
.order-detail-table td:nth-child(2),
.order-detail-table th:nth-child(3),
.order-detail-table td:nth-child(3),
.order-detail-table th:nth-child(4),
.order-detail-table td:nth-child(4) {
  width: 16%;
}

.order-installment-table th,
.order-installment-table td {
  width: 33.333%;
}

.transfer-records-table th:nth-child(1),
.transfer-records-table td:nth-child(1) {
  width: 58%;
}

.transfer-records-table th:nth-child(2),
.transfer-records-table td:nth-child(2) {
  width: 20%;
}

.transfer-records-table th:nth-child(3),
.transfer-records-table td:nth-child(3) {
  width: 22%;
}

.transfer-record-main {
  min-width: 0;
}

.transfer-record-number {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transfer-record-state {
  display: grid;
  align-content: center;
  gap: 6px;
}

.transfer-record-state .badge {
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.transfer-record-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
  gap: 6px;
}

.transfer-record-actions .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
  white-space: nowrap;
}

.transfers-table th:nth-child(1),
.transfers-table td:nth-child(1),
.transfers-table th:nth-child(2),
.transfers-table td:nth-child(2),
.transfers-table th:nth-child(3),
.transfers-table td:nth-child(3),
.transfers-table th:nth-child(4),
.transfers-table td:nth-child(4) {
  width: 25%;
}

.transfers-table th:nth-child(n + 5),
.transfers-table td:nth-child(n + 5) {
  width: 12%;
}

.bar-tab-table th:nth-child(1),
.bar-tab-table td:nth-child(1) {
  width: 46%;
}

.bar-tab-table th:nth-child(2),
.bar-tab-table td:nth-child(2),
.bar-tab-table th:nth-child(3),
.bar-tab-table td:nth-child(3),
.bar-tab-table th:nth-child(4),
.bar-tab-table td:nth-child(4) {
  width: 18%;
}

.fuel-sales-table th:nth-child(1),
.fuel-sales-table td:nth-child(1) {
  width: 24%;
}

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

.fuel-sales-table th:nth-child(3),
.fuel-sales-table td:nth-child(3) {
  width: 18%;
}

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

.fuel-sales-table th:nth-child(5),
.fuel-sales-table td:nth-child(5) {
  width: 18%;
}

.fuel-shifts-table th:nth-child(1),
.fuel-shifts-table td:nth-child(1) {
  width: 31%;
}

.fuel-shifts-table th:nth-child(2),
.fuel-shifts-table td:nth-child(2) {
  width: 21%;
}

.fuel-shifts-table th:nth-child(3),
.fuel-shifts-table td:nth-child(3) {
  width: 24%;
}

.fuel-shifts-table th:nth-child(4),
.fuel-shifts-table td:nth-child(4) {
  width: 24%;
}

.report-items-table th:nth-child(1),
.report-items-table td:nth-child(1) {
  width: 28%;
}

.report-store-summary-table th:nth-child(1),
.report-store-summary-table td:nth-child(1) {
  width: 24%;
}

.report-store-summary-table th:nth-child(2),
.report-store-summary-table td:nth-child(2),
.report-store-summary-table th:nth-child(3),
.report-store-summary-table td:nth-child(3),
.report-store-summary-table th:nth-child(4),
.report-store-summary-table td:nth-child(4),
.report-store-summary-table th:nth-child(5),
.report-store-summary-table td:nth-child(5) {
  width: 19%;
}

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

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

.report-items-table th:nth-child(4),
.report-items-table td:nth-child(4),
.report-items-table th:nth-child(5),
.report-items-table td:nth-child(5),
.report-items-table th:nth-child(6),
.report-items-table td:nth-child(6) {
  width: 16%;
}

.report-payments-table th:nth-child(1),
.report-payments-table td:nth-child(1) {
  width: 24%;
}

.report-payments-table th:nth-child(2),
.report-payments-table td:nth-child(2) {
  width: 17%;
}

.report-payments-table th:nth-child(3),
.report-payments-table td:nth-child(3) {
  width: 25%;
}

.report-payments-table th:nth-child(4),
.report-payments-table td:nth-child(4) {
  width: 17%;
}

.report-payments-table th:nth-child(5),
.report-payments-table td:nth-child(5) {
  width: 17%;
}

.report-refunds-table th:nth-child(1),
.report-refunds-table td:nth-child(1) {
  width: 22%;
}

.report-refunds-table th:nth-child(2),
.report-refunds-table td:nth-child(2) {
  width: 17%;
}

.report-refunds-table th:nth-child(3),
.report-refunds-table td:nth-child(3) {
  width: 26%;
}

.report-refunds-table th:nth-child(4),
.report-refunds-table td:nth-child(4) {
  width: 16%;
}

.report-refunds-table th:nth-child(5),
.report-refunds-table td:nth-child(5) {
  width: 19%;
}

#reportProductActivityTableElement.report-activity-table {
  min-width: 0;
}

.report-activity-table th:nth-child(1),
.report-activity-table td:nth-child(1) {
  width: 16%;
}

.report-activity-table th:nth-child(2),
.report-activity-table td:nth-child(2) {
  width: 23%;
}

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

.report-activity-table th:nth-child(4),
.report-activity-table td:nth-child(4) {
  width: 28%;
}

.report-activity-table th:nth-child(5),
.report-activity-table td:nth-child(5) {
  width: 23%;
}

.fit-table .change-list,
.fit-table .customer-history-items {
  min-width: 0;
}

.meta-stack {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.store-expiry-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.store-expiry-summary button {
  min-width: 0;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.store-expiry-summary button:hover,
.store-expiry-summary button.active {
  border-color: var(--primary);
  background: #eef8f5;
}

.store-expiry-summary strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.store-expiry-summary span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.store-admin-table th:nth-child(1),
.store-admin-table td:nth-child(1) {
  width: 20%;
}

.store-admin-table th:nth-child(2),
.store-admin-table td:nth-child(2) {
  width: 17%;
}

.store-admin-table th:nth-child(3),
.store-admin-table td:nth-child(3) {
  width: 13%;
}

.store-admin-table th:nth-child(4),
.store-admin-table td:nth-child(4) {
  width: 13%;
}

.store-admin-table th:nth-child(5),
.store-admin-table td:nth-child(5) {
  width: 13%;
}

.store-admin-table th:nth-child(6),
.store-admin-table td:nth-child(6) {
  width: 12%;
}

.store-admin-table th:nth-child(7),
.store-admin-table td:nth-child(7) {
  width: 12%;
}

.staff-admin-table th:nth-child(1),
.staff-admin-table td:nth-child(1) {
  width: 23%;
}

.staff-admin-table th:nth-child(2),
.staff-admin-table td:nth-child(2) {
  width: 12%;
}

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

.staff-admin-table th:nth-child(4),
.staff-admin-table td:nth-child(4) {
  width: 29%;
}

.staff-admin-table th:nth-child(5),
.staff-admin-table td:nth-child(5) {
  width: 9%;
}

.staff-admin-table th:nth-child(6),
.staff-admin-table td:nth-child(6) {
  width: 11%;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 17%;
}

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

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

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

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

.product-thumb,
.product-image-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  object-fit: cover;
}

.product-thumb {
  width: 54px;
  height: 54px;
  font-size: 11px;
  text-align: center;
}

.product-image-large {
  width: 160px;
  height: 120px;
}

.product-image-large.empty {
  width: 160px;
  height: 120px;
}

.product-image-editor {
  display: grid;
  gap: 10px;
}

.product-image-preview {
  min-height: 120px;
}

.store-profile-form {
  display: grid;
  gap: 16px;
}

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

.store-profile-grid .full {
  grid-column: 1 / -1;
}

.store-profile-grid input[readonly] {
  background: #f4f7f6;
  color: var(--muted);
}

.store-profile-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.store-profile-section h3 {
  margin: 0;
}

.print-settings-groups {
  display: grid;
  gap: 16px;
}

.print-settings-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.print-settings-group h3 {
  margin: 0;
  font-size: 18px;
}

.print-settings-group .store-profile-grid {
  gap: 12px;
}

.input-suffix-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.input-suffix-field input {
  border-radius: 8px 0 0 8px;
}

.input-suffix-field span {
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  background: #f8fbfa;
  color: var(--muted);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.store-print-check {
  align-self: end;
  min-height: 38px;
}

.product-duplicate {
  display: grid;
  gap: 10px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  padding: 12px;
  background: #fff8e8;
}

.product-duplicate strong {
  color: #8a4d00;
}

.product-duplicate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.product-duplicate-grid div {
  border: 1px solid rgba(138, 77, 0, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.product-duplicate-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.member-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.member-fields small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.member-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.member-summary-grid div {
  min-width: 0;
  min-height: 82px;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.member-summary-grid span,
.member-summary-grid strong,
.member-summary-grid small {
  display: block;
}

.member-summary-grid span,
.member-summary-grid small {
  color: var(--muted);
}

.member-summary-grid strong {
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.member-summary-grid small {
  margin-top: 4px;
}

.inventory-active-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.inventory-active-info:empty {
  display: none;
}

.inventory-active-info div,
.inventory-report-grid .metric-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}

.inventory-active-info span {
  display: block;
  color: var(--muted);
}

.inventory-active-info strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.inventory-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.panel-heading.compact {
  align-items: flex-start;
  margin-bottom: 10px;
}

.panel-heading.compact h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.inventory-adjust-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stock-in-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  background: #eef9f5;
}

.stock-in-steps span {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cfe5df;
  border-radius: 7px;
  background: #fff;
  color: var(--primary-strong);
  font-weight: 800;
  line-height: 1.25;
}

.inventory-adjust-panel .field-grid {
  margin-bottom: 0;
}

.inventory-adjust-search {
  align-items: stretch;
}

.inventory-adjust-search input {
  flex: 1 1 220px;
}

.inventory-adjust-search .btn {
  min-width: 86px;
}

.inventory-adjust-panel .product-results {
  display: grid;
  gap: 8px;
}

.inventory-adjust-panel .result-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: #c6ddd7;
  background: #fbfefd;
}

.inventory-adjust-selected {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #8fc7ba;
  border-radius: 8px;
  background: #f0fbf7;
}

.inventory-adjust-selected:empty {
  display: none;
}

.inventory-adjust-selected span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-adjust-selected strong {
  display: block;
  overflow-wrap: anywhere;
}

.inventory-adjust-price-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 8px;
  min-width: min(620px, 100%);
}

.inventory-adjust-price-grid > div {
  padding: 8px 10px;
  border: 1px solid #c8dfd9;
  border-radius: 8px;
  background: #fff;
}

.inventory-movement-heading {
  margin-top: 14px;
}

.inventory-low-stock-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.low-stock-controls {
  margin-bottom: 0;
}

.low-stock-summary-grid .metric-tile strong {
  font-size: 18px;
}

.inventory-table,
.inventory-counts-table,
.inventory-movements-table,
.low-stock-table {
  overflow-x: hidden;
}

.inventory-table table,
.inventory-counts-table table,
.inventory-movements-table table,
.low-stock-table table {
  min-width: 0;
  table-layout: fixed;
}

.inventory-table th,
.inventory-table td,
.inventory-counts-table th,
.inventory-counts-table td,
.inventory-movements-table th,
.inventory-movements-table td,
.low-stock-table th,
.low-stock-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.inventory-table td:first-child {
  min-width: 0;
}

.inventory-table input {
  width: 100%;
  min-width: 0;
  max-width: 150px;
}

.inventory-entry-table th:nth-child(1),
.inventory-entry-table td:nth-child(1) {
  width: 30%;
}

.inventory-entry-table th:nth-child(2),
.inventory-entry-table td:nth-child(2),
.inventory-entry-table th:nth-child(3),
.inventory-entry-table td:nth-child(3),
.inventory-entry-table th:nth-child(4),
.inventory-entry-table td:nth-child(4) {
  width: 14%;
}

.inventory-entry-table th:nth-child(5),
.inventory-entry-table td:nth-child(5) {
  width: 13%;
}

.inventory-entry-table th:nth-child(6),
.inventory-entry-table td:nth-child(6) {
  width: 15%;
}

.inventory-counts-fit-table th:nth-child(1),
.inventory-counts-fit-table td:nth-child(1) {
  width: 24%;
}

.inventory-counts-fit-table th:nth-child(2),
.inventory-counts-fit-table td:nth-child(2),
.inventory-counts-fit-table th:nth-child(3),
.inventory-counts-fit-table td:nth-child(3) {
  width: 14%;
}

.inventory-counts-fit-table th:nth-child(4),
.inventory-counts-fit-table td:nth-child(4) {
  width: 13%;
}

.inventory-counts-fit-table th:nth-child(5),
.inventory-counts-fit-table td:nth-child(5) {
  width: 17%;
}

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

.inventory-counts-fit-table .inline-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  justify-content: stretch;
  gap: 6px;
}

.inventory-counts-fit-table .inline-actions .btn {
  width: 100%;
  min-width: 0;
}

.inventory-movements-fit-table th:nth-child(1),
.inventory-movements-fit-table td:nth-child(1) {
  width: 24%;
}

.inventory-movements-fit-table th:nth-child(2),
.inventory-movements-fit-table td:nth-child(2),
.inventory-movements-fit-table th:nth-child(3),
.inventory-movements-fit-table td:nth-child(3),
.inventory-movements-fit-table th:nth-child(4),
.inventory-movements-fit-table td:nth-child(4) {
  width: 12%;
}

.inventory-movements-fit-table th:nth-child(5),
.inventory-movements-fit-table td:nth-child(5) {
  width: 18%;
}

.inventory-movements-fit-table th:nth-child(6),
.inventory-movements-fit-table td:nth-child(6),
.inventory-movements-fit-table th:nth-child(7),
.inventory-movements-fit-table td:nth-child(7) {
  width: 11%;
}

.low-stock-fit-table th:nth-child(1),
.low-stock-fit-table td:nth-child(1) {
  width: 30%;
}

.low-stock-fit-table th:nth-child(2),
.low-stock-fit-table td:nth-child(2),
.low-stock-fit-table th:nth-child(3),
.low-stock-fit-table td:nth-child(3),
.low-stock-fit-table th:nth-child(4),
.low-stock-fit-table td:nth-child(4),
.low-stock-fit-table th:nth-child(5),
.low-stock-fit-table td:nth-child(5) {
  width: 14%;
}

.low-stock-fit-table th:nth-child(6),
.low-stock-fit-table td:nth-child(6) {
  width: 14%;
}

.marketing-leads-table th:nth-child(1),
.marketing-leads-table td:nth-child(1) {
  width: 14%;
}

.marketing-leads-table th:nth-child(2),
.marketing-leads-table td:nth-child(2) {
  width: 21%;
}

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

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

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

.marketing-leads-table th:nth-child(6),
.marketing-leads-table td:nth-child(6) {
  width: 19%;
}

.marketing-leads-table .inline-actions {
  justify-content: flex-end;
}

.marketing-leads-table .inline-actions .btn {
  min-height: 34px;
  padding: 0 10px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf2f7;
  color: #355066;
  font-size: 12px;
}

.badge.danger {
  background: #fff0ef;
  color: var(--danger);
}

.badge.warn {
  background: #fff5df;
  color: var(--warn);
}

.badge.good {
  background: #eaf7ef;
  color: var(--good);
}

.badge.info {
  background: #e8f5ff;
  color: #0b5d83;
}

.quotation-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.permission-summary {
  max-width: 220px;
  color: var(--muted);
  font-size: 13px;
}

.staff-table {
  min-width: 1180px;
  table-layout: fixed;
}

.staff-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-table td:nth-child(6),
.staff-table td:nth-child(8) {
  overflow: visible;
  text-overflow: clip;
}

.staff-table th:nth-child(1),
.staff-table td:nth-child(1) {
  width: 210px;
}

.staff-table th:nth-child(2),
.staff-table td:nth-child(2),
.staff-table th:nth-child(3),
.staff-table td:nth-child(3),
.staff-table th:nth-child(4),
.staff-table td:nth-child(4),
.staff-table th:nth-child(7),
.staff-table td:nth-child(7) {
  width: 110px;
}

.staff-table th:nth-child(5),
.staff-table td:nth-child(5) {
  width: 160px;
}

.staff-table th:nth-child(6),
.staff-table td:nth-child(6) {
  width: 340px;
}

.staff-table th:nth-child(8),
.staff-table td:nth-child(8) {
  width: 140px;
}

.staff-table .permission-summary {
  max-width: none;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.permission-chip-list {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.permission-chip {
  display: inline-flex;
  max-width: 112px;
  min-height: 24px;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf2f7;
  color: #425d59;
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-chip.more {
  flex: 0 0 auto;
  background: #eaf7ef;
  color: var(--good);
}

.permission-list {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.permission-list strong,
.permission-list small {
  display: block;
}

.permission-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.field-row label,
.field-grid label,
.totals label,
.modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field-row label {
  flex: 1 1 260px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

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

.installment-panel {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.installment-panel .field-grid {
  margin: 10px 0 0;
}

.installment-schedule {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 4px;
  order: 2;
}

.installment-fields > label:nth-child(3),
.installment-fields > label:nth-child(4) {
  order: 3;
}

.installment-schedule h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.installment-date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.installment-date-grid label {
  margin: 0;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
}

.plain-number {
  appearance: textfield;
  -moz-appearance: textfield;
}

.plain-number::-webkit-outer-spin-button,
.plain-number::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.customer-picker {
  position: relative;
}

.customer-picker input[type="search"] {
  width: 100%;
}

.customer-picker-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 30, 35, 0.16);
}

.customer-picker-option {
  width: 100%;
  min-height: 52px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.customer-picker-option:hover,
.customer-picker-option:focus {
  outline: 0;
  background: #eef8f5;
}

.customer-picker-option span,
.customer-picker-empty {
  color: var(--muted);
  font-size: 12px;
}

.customer-picker-empty {
  padding: 10px;
}

.error-text {
  color: #b42318;
}

.client-wizard-intro {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf8;
}

.client-wizard-intro strong {
  color: var(--ink);
  font-size: 16px;
}

.client-wizard-intro span {
  color: var(--muted);
  line-height: 1.4;
}

.client-wizard-lead-source {
  background: #fff9ed;
  border-color: #f0c56b;
}

.client-wizard-section {
  display: grid;
  gap: 10px;
}

.client-wizard-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.client-wizard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.client-wizard-card {
  position: relative;
  min-height: 96px;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.client-wizard-card:has(input:checked) {
  border-color: var(--primary);
  background: #eef8f5;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.client-wizard-card input {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.client-wizard-card span {
  padding-right: 26px;
  font-weight: 800;
}

.client-wizard-card small {
  display: block;
  padding-right: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.client-wizard-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-wizard-action-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.client-wizard-action-field .btn {
  min-width: 118px;
  white-space: nowrap;
}

.client-wizard-date-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.client-wizard-date-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.client-wizard-summary,
.client-wizard-result-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.client-wizard-summary span,
.client-wizard-result-grid span {
  color: var(--muted);
  font-size: 12px;
}

.client-wizard-summary strong,
.client-wizard-result-grid strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.client-wizard-result {
  display: grid;
  gap: 12px;
}

.client-wizard-result p {
  color: var(--muted);
  line-height: 1.45;
}

.client-wizard-link {
  display: block;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.client-wizard-links {
  display: grid;
  gap: 8px;
}

.client-wizard-copy-box {
  min-height: 132px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.filter-bar {
  margin-bottom: 12px;
}

.filter-bar input {
  min-width: 0;
  flex: 1 1 260px;
}

.filter-bar select {
  min-width: 0;
  max-width: 220px;
}

#auditUserFilterHint {
  flex: 1 1 100%;
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.filter-label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.filter-label input {
  min-height: 38px;
}

.search-list {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
}

.result-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

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

.result-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cart-table input {
  width: 100%;
  min-width: 0;
}

.cart-product-info {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.discount-control {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1fr);
  gap: 8px;
}

.totals {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 0.85fr));
  align-items: end;
  gap: 10px;
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.discount-total,
.total-card {
  min-width: 0;
}

.member-points-panel {
  grid-column: 1 / -1;
  min-width: 0;
  order: 5;
  padding: 10px;
  border: 1px solid #bdd8d0;
  border-radius: 8px;
  background: #f4fbf8;
}

.member-points-panel input {
  min-height: 38px;
}

.member-points-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.member-points-meta span,
.member-points-meta strong {
  display: inline;
  text-align: left;
}

.member-points-panel .quiet {
  margin: 8px 0 0;
  font-size: 12px;
}

.portal-settings {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bdd8d0;
  border-radius: 8px;
  background: #f4fbf8;
}

.portal-settings h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.portal-link-box {
  display: grid;
  gap: 6px;
}

.portal-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.portal-link-row input {
  background: #fff;
}

.cart-warning {
  margin: -2px 0 12px;
  color: var(--warn);
  font-size: 13px;
}

.quote-convert-warning {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #f2c36b;
  border-radius: 8px;
  background: #fff7e6;
  color: #7b4b00;
  line-height: 1.4;
}

.quote-convert-warning strong,
.quote-convert-warning span {
  display: block;
}

.totals div span,
.totals div strong {
  display: block;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.totals div span {
  color: var(--muted);
}

.totals div strong {
  margin-top: 4px;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.15;
}

.totals .member-points-meta span,
.totals .member-points-meta strong {
  display: inline;
  text-align: left;
}

.totals .member-points-meta strong {
  margin-top: 0;
  font-size: inherit;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
}

.bar-layout {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(260px, 0.9fr) minmax(450px, 1.5fr);
  gap: 20px;
  align-items: start;
}

.bar-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.bar-table-card {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  text-align: left;
  padding: 14px;
  cursor: pointer;
}

.bar-table-card strong,
.bar-table-card span,
.bar-table-card small {
  display: block;
}

.bar-table-card span,
.bar-table-card small {
  color: var(--muted);
}

.bar-table-card.occupied {
  border-color: rgba(18, 120, 103, 0.4);
  background: #eef8f5;
}

.bar-table-card.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#barView .btn,
#barView input,
#barView select,
#modalForm [data-bar-control] {
  min-height: 46px;
}

.bar-toolbar,
.bar-checkout-actions,
.bar-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bar-line-actions .btn { width: 100%; padding: 8px; }
.bar-amount-due { display: grid; gap: 4px; text-align: right; }
.bar-amount-due > span { color: var(--muted); font-size: 13px; }
.bar-amount-due > strong { font-size: 24px; color: var(--primary); }
.bar-tax-summary:empty { display: none; }
.bar-tax-summary { margin: 0 0 12px; text-align: right; }
.bar-payment-status { min-height: 46px; padding: 12px; background: #f2f5f8; border-radius: 8px; }
.bar-payment-warning { color: #8a3a12; background: #fff3e8; }
.bar-last-sale { margin-top: 16px; padding: 14px; border: 1px solid #bed8cb; border-radius: 8px; background: #f0f8f3; overflow-wrap: anywhere; }
.bar-last-sale[hidden] { display: none; }
.bar-last-sale p { margin: 8px 0 12px; color: var(--muted); line-height: 1.5; }
.bar-tab-table th:first-child, .bar-tab-table td:first-child { width: 32%; }
.bar-tab-table th:nth-child(2), .bar-tab-table td:nth-child(2) { width: 10%; }
.bar-tab-table th:nth-child(3), .bar-tab-table td:nth-child(3),
.bar-tab-table th:nth-child(4), .bar-tab-table td:nth-child(4) { width: 16%; }
.bar-tab-table th:nth-child(5), .bar-tab-table td:nth-child(5) { width: 26%; }

@media (min-width: 1121px) and (max-width: 1440px) {
  .bar-layout { grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr); }
  .bar-layout > .work-panel:last-child { grid-column: 1 / -1; }
}

.inline-actions.right {
  justify-content: flex-end;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 20, 22, 0.5);
  z-index: 20;
}

.modal {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

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

.modal-body .full {
  grid-column: 1 / -1;
}

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-modal {
  width: min(560px, 100%);
}

.confirm-message {
  padding: 8px 0;
  color: var(--text);
  line-height: 1.5;
}

.print-area {
  display: none;
}

.print-doc {
  color: #000000;
  background: #ffffff;
  font-family: Arial, sans-serif;
}

.print-doc h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.print-doc .print-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #000000;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.print-doc .print-meta {
  text-align: right;
  line-height: 1.5;
}

.print-doc .print-status-banner {
  border: 2px solid #b91c1c;
  background: #fff1f2;
  color: #7f1d1d;
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 8px 10px;
}

.print-doc .print-status-banner strong {
  color: #991b1b;
  font-size: 18px;
  text-transform: uppercase;
}

.print-doc .print-status-banner span {
  color: #7f1d1d;
  font-size: 12px;
  line-height: 1.4;
}

.print-doc table {
  border-collapse: collapse;
  width: 100%;
}

.print-doc th,
.print-doc td {
  border-bottom: 1px solid #333333;
  color: #000000;
  padding: 7px 6px;
}

.print-doc .print-total {
  margin-top: 12px;
  margin-left: auto;
  width: 280px;
  display: grid;
  gap: 6px;
}

.print-doc .print-total div {
  display: flex;
  justify-content: space-between;
}

.print-doc .installment-print-schedule {
  margin-top: 12px;
}

.print-doc .installment-print-schedule h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.print-doc .installment-print-schedule table {
  font-size: 12px;
}

.print-doc.receipt {
  width: 76mm;
  font-size: 12px;
}

.print-doc.receipt h1 {
  font-size: 18px;
}

.print-doc.receipt .print-head {
  display: block;
  text-align: center;
}

.print-doc.receipt .print-meta {
  text-align: center;
}

.print-doc.receipt th,
.print-doc.receipt td {
  padding: 5px 2px;
  white-space: normal;
}

.print-doc.receipt .print-total {
  width: 100%;
}

.print-doc .print-footer {
  border-top: 1px dashed #555555;
  margin-top: 10px;
  padding-top: 8px;
  text-align: center;
}

.print-doc.waybill {
  font-size: 14px;
  line-height: 1.45;
}

.print-doc.waybill .waybill-head {
  border-bottom: 2px solid #000000;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.print-doc.waybill .waybill-meta {
  min-width: 220px;
  display: grid;
  gap: 6px;
}

.print-doc.waybill .waybill-meta div,
.print-doc.waybill .waybill-customer-grid div {
  display: grid;
  gap: 3px;
}

.print-doc.waybill span {
  color: #333333;
  font-size: 12px;
}

.print-doc.waybill h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

.print-doc.waybill .waybill-copy-label {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
}

.print-doc.waybill .waybill-section {
  margin-top: 14px;
}

.print-doc.waybill .waybill-customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.print-doc.waybill .waybill-customer-grid .full {
  grid-column: 1 / -1;
}

.print-doc.waybill table {
  table-layout: fixed;
}

.print-doc.waybill th:nth-child(1),
.print-doc.waybill td:nth-child(1) {
  width: 46%;
}

.print-doc.waybill th:nth-child(2),
.print-doc.waybill td:nth-child(2) {
  width: 14%;
  text-align: right;
}

.print-doc.waybill table.waybill-prices-hidden th:nth-child(1),
.print-doc.waybill table.waybill-prices-hidden td:nth-child(1) {
  width: 76%;
}

.print-doc.waybill table.waybill-prices-hidden th:nth-child(2),
.print-doc.waybill table.waybill-prices-hidden td:nth-child(2) {
  width: 24%;
}

.print-doc.waybill th:nth-child(3),
.print-doc.waybill td:nth-child(3),
.print-doc.waybill th:nth-child(4),
.print-doc.waybill td:nth-child(4) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}

.print-doc.waybill .num {
  text-align: right;
  white-space: nowrap;
}

.print-doc.waybill .waybill-total {
  display: grid;
  gap: 5px;
  margin: 10px 0 0 auto;
  width: min(320px, 100%);
}

.print-doc.waybill .waybill-total div {
  align-items: center;
  border-bottom: 1px solid #999999;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 3px 0;
}

.print-doc.waybill .waybill-total .grand {
  border-bottom: 2px solid #000000;
  font-size: 15px;
}

.print-doc.waybill .waybill-note {
  border: 1px solid #333333;
  min-height: 64px;
  padding: 8px;
}

.print-doc.waybill-half-sheet {
  font-size: 11.5px;
  line-height: 1.25;
}

.print-doc.waybill-half-sheet .waybill-half-copy {
  min-height: 124mm;
}

.print-doc.waybill-half-sheet .waybill-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.print-doc.waybill-half-sheet .waybill-section {
  margin-top: 8px;
}

.print-doc.waybill-half-sheet .waybill-note {
  min-height: 36px;
  padding: 5px;
}

.print-doc.waybill-half-sheet .waybill-total {
  gap: 2px;
  margin-top: 5px;
}

.print-doc.waybill-half-sheet th,
.print-doc.waybill-half-sheet td {
  padding: 4px 5px;
}

.print-doc.waybill-half-sheet h1 {
  font-size: 18px;
  margin: 0;
}

.print-doc.waybill-half-sheet h2 {
  font-size: 12px;
  margin-bottom: 4px;
}

.waybill-cut-line {
  border-top: 1px dashed #666666;
  color: #666666;
  font-size: 10px;
  margin: 3mm 0;
  padding-top: 2mm;
  text-align: center;
}

.print-doc.receipt + .print-doc.receipt {
  break-before: page;
  page-break-before: always;
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

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

  .split-layout,
  .sale-grid,
  .bar-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .quotation-status-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
  }

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

  .main-panel {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .metric-grid.compact,
  .member-summary-grid,
  .field-grid,
  .store-profile-grid,
  .client-wizard-field-grid,
  .client-wizard-summary,
  .client-wizard-result-grid,
  .modal-body,
  .customer-history-download,
  .totals {
    grid-template-columns: 1fr;
  }

  .totals div span,
  .totals div strong {
    text-align: left;
  }

  .client-wizard-action-field {
    grid-template-columns: 1fr;
  }

  .inventory-adjust-selected {
    grid-template-columns: 1fr;
  }

  .stock-in-steps {
    grid-template-columns: 1fr;
  }

  .inventory-adjust-price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .client-wizard-action-field .btn {
    width: 100%;
  }

  .quotation-scope-tabs {
    grid-template-columns: 1fr;
  }

  .quotation-status-cards {
    grid-template-columns: 1fr;
  }

  .reminder-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #ffffff;
  }

  .app-shell,
  .modal-overlay {
    display: none !important;
  }

  .print-area {
    display: block;
  }

  .print-area .print-doc {
    display: block;
  }
}
