:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-soft: #fbfaf6;
  --ink: #1e2624;
  --muted: #71807b;
  --line: #e5e0d7;
  --brand: #124b43;
  --brand-2: #2c7067;
  --accent: #d66b4d;
  --gold: #d9a441;
  --green: #31a66a;
  --blue: #5177b9;
  --danger: #c84646;
  --shadow: 0 12px 30px rgba(24, 44, 39, 0.08);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #ece8df;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(20, 40, 35, 0.04);
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  padding: 20px 16px;
  place-items: center;
  background: radial-gradient(circle at 88% 8%, rgba(217, 164, 65, 0.22), transparent 31%), linear-gradient(160deg, #0d3832 0%, #1b5b50 46%, #dbe6df 46%, #f6f4ef 100%);
}

.auth-panel {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 56px rgba(8, 45, 39, 0.22);
}

.auth-panel-body {
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.auth-brand-hero {
  position: relative;
  min-height: 170px;
  padding: 24px 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #0c3e36, #1f665b);
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
}

.auth-brand h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.auth-brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.auth-eyebrow {
  margin: 0 0 5px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.auth-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.auth-orbit-one {
  top: -66px;
  right: -34px;
  width: 190px;
  height: 190px;
}

.auth-orbit-two {
  right: 58px;
  bottom: -104px;
  width: 170px;
  height: 170px;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-review-note {
  margin-top: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel .auth-tabs button {
  border-radius: 12px;
}

.auth-panel .auth-tabs button.active {
  background: var(--brand-2);
  border-color: var(--brand-2);
}

.auth-field {
  margin: 0;
}

.auth-panel .field input,
.auth-panel .field select {
  min-height: 48px;
}

.auth-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #dce5e0;
  border-radius: 14px;
  background: #fff;
  color: var(--brand-2);
}

.auth-input:focus-within {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(44, 112, 103, 0.14);
}

.auth-input input {
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
}

.auth-field .auth-input input {
  flex: 1;
  width: auto;
  border-radius: 0;
  background: transparent;
}

.auth-password-control {
  position: relative;
  padding-right: 96px;
}

.auth-password-control button {
  position: absolute;
  right: 0;
  top: 0;
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: #edf5f1;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.auth-panel .primary-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
}

.auth-status-body {
  display: grid;
  gap: 14px;
}

.auth-status-body .auth-card {
  margin: 0;
}

.auth-status-body .secondary-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
}

.auth-message {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #fff4f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.auth-recovery-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--brand-2);
  font-size: 13px;
  font-weight: 700;
}

.auth-recovery-head,
.auth-code-row,
.auth-recovery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-recovery-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.auth-code-row .auth-input {
  flex: 1;
}

.auth-code-row button {
  min-width: 104px;
  min-height: 48px;
}

.auth-recovery-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.auth-card {
  margin: 12px 0;
}

.screen {
  min-height: 100vh;
  padding-bottom: 88px;
}

.screen.detail {
  padding-bottom: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 64px;
  padding-top: env(safe-area-inset-top);
  background: var(--brand);
  color: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 24px;
}

.content {
  padding: 14px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: min(100%, 430px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.nav-item {
  display: grid;
  gap: 3px;
  place-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #4d5a56;
  font-size: 12px;
}

.nav-item strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: inherit;
  font-weight: 700;
}

.nav-item strong .lucide-icon {
  width: 21px;
  height: 21px;
}

.nav-item.active {
  background: #edf5f1;
  color: var(--brand);
}

.hero-card,
.card,
.module-card,
.form-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(22, 63, 58, 0.96), rgba(44, 122, 111, 0.9)),
    var(--brand);
  color: #fff;
}

.hero-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.hero-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: #f6f4ef;
  color: var(--brand);
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-title {
  margin: 0 0 5px;
  font-size: 22px;
  line-height: 1.2;
}

.hero-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.55;
}

.ai-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f1ec;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.section {
  margin-top: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 17px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

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

.inventory-overview > div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.inventory-overview small,
.inventory-history-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.inventory-overview b {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 20px;
}

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

.inventory-task-summary .metric-card {
  min-height: 76px;
}

.inventory-task-summary .metric-card:last-child {
  grid-column: span 2;
}

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

.inventory-primary-action {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid rgba(18, 75, 67, 0.12);
  border-radius: 8px;
  text-align: left;
}

.inventory-primary-action span {
  display: grid;
  place-items: center;
}

.inventory-primary-action strong {
  min-width: 0;
}

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

.inventory-recent-list .inventory-history-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inventory-more-tools {
  margin-top: 10px;
}

.inventory-more-tools > .secondary-btn {
  width: 100%;
  min-height: 44px;
}

.inventory-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.inventory-more-action {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.inventory-more-action span {
  display: grid;
  place-items: center;
  color: var(--brand);
}

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

.after-sales-card {
  padding: 14px;
}

.after-sales-card h3 {
  margin: 0 0 8px;
}

.after-sales-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.after-sales-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

.after-sales-submit-panel > .secondary-btn {
  width: 100%;
  min-height: 44px;
}

.inventory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.inventory-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf5f1;
  color: var(--brand);
  font-size: 12px;
}

.inventory-product-image {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f7f5;
  color: var(--muted);
  font-size: 11px;
}

.inventory-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-batch-card .card-row > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.inventory-quantity {
  color: var(--accent);
  font-size: 22px;
}

.inventory-history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.inventory-history-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.inventory-history-item:last-child {
  border-bottom: 0;
}

.inventory-history-item b,
.inventory-history-item p {
  display: block;
  margin: 4px 0 0;
}

.inventory-history-item p {
  color: var(--muted);
  font-size: 12px;
}

.inventory-history-change {
  flex: 0 0 auto;
  font-size: 17px;
}

.inventory-history-change.positive {
  color: var(--brand);
}

.inventory-history-change.negative {
  color: var(--danger);
}

.metric-card {
  padding: 12px;
  min-height: 88px;
}

.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-card b {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 20px;
}

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

.tile {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 92px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(18, 75, 67, 0.12);
  border-radius: 14px;
  background: #eef7f4;
  color: var(--brand);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(18, 75, 67, 0.08);
}

.lucide-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-icon .lucide-icon {
  width: 27px;
  height: 27px;
}

.tile-icon.mini {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 8px;
  vertical-align: middle;
  box-shadow: none;
}

.tile-icon.mini .lucide-icon {
  width: 16px;
  height: 16px;
}

.tile span:last-child {
  width: 100%;
  min-height: 32px;
  color: #24302c;
  font-size: 13px;
  line-height: 1.25;
}

.c1,
.c2,
.c3,
.c4,
.c5,
.c6,
.c7,
.c8 {
  background: #eef7f4;
  color: var(--brand);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
}

.secondary-btn {
  background: #f0efe7;
  color: var(--brand);
  border-color: var(--line);
}

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

.ghost-btn {
  min-height: 34px;
  background: transparent;
  color: var(--brand);
  border-color: var(--line);
}

.primary-btn.compact,
.secondary-btn.compact,
.ghost-btn.compact {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.primary-btn:disabled,
.secondary-btn:disabled,
.danger-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.card {
  padding: 12px;
  margin-bottom: 10px;
}

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

.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf5f1;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.status.warn,
.status.warning {
  background: #fff3d5;
  color: #a06b00;
}

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

.card p.print-record-error {
  color: var(--danger);
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.searchbar input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.filters,
.segmented {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.filters button,
.segmented button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #394541;
}

.filters button.active,
.segmented button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.form-card {
  padding: 14px;
  margin-bottom: 12px;
}

.payment-method-settings { display: grid; gap: 10px; }
.payment-method-setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.payment-method-setting.is-disabled { opacity: .55; }
.payment-method-order { display: flex; gap: 6px; }
.payment-role-defaults { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.payment-method-order button { min-height: 44px; }
.payment-role-defaults select { min-height: 44px; }

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-panel {
  padding: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #3c4a45;
  font-size: 13px;
  font-weight: 700;
}

.field .inline-check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 0;
}

.lens-field-tip,
.lens-warning {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lens-eye-grid,
.lens-results {
  display: grid;
  gap: 12px;
}

.lens-field-tip + .lens-eye-grid {
  margin-top: 16px;
}

.lens-eye-card {
  min-width: 0;
}

.lens-eye-card + .lens-eye-card {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lens-eye-card h3 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 15px;
}

.lens-eye-card select {
  min-height: 50px;
  font-size: 16px;
  font-weight: 800;
}

.lens-result-card {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.lens-result-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.lens-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.lens-result-head > div {
  display: grid;
  gap: 2px;
}

.lens-result-head strong {
  color: var(--brand);
  font-size: 15px;
}

.lens-result-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lens-result-head b {
  color: var(--accent);
  font-size: 22px;
}

.lens-result-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.lens-result-grid span,
.lens-result-grid b {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lens-result-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lens-result-grid b {
  color: var(--ink);
  font-size: 13px;
}

.lens-astigmatism-note,
.lens-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.lens-empty {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: center;
}

.lens-warning {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff8e8;
  color: #7d5a12;
}

.required::before {
  content: "*";
  color: var(--danger);
  margin-right: 3px;
}

.radio-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.radio-row label,
.check-row label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  color: #3d4845;
  font-weight: 600;
}

.permission-grid {
  display: grid;
  gap: 10px;
}

.permission-group {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.permission-group b {
  display: block;
  margin-bottom: 8px;
}

.role-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.employee-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.role-toolbar :is(button, input, select) {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 12px;
  color: var(--ink);
}

.role-form-card :is(input, select),
.employee-form-card :is(input, select) {
  min-height: 44px;
}

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

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

.role-card-main,
.role-summary-card,
.permission-card-head,
.role-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.role-card h3,
.role-summary-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.role-card p,
.role-summary-card p,
.hint-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.role-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef7f4;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.role-meta-row {
  color: var(--muted);
  font-size: 13px;
}

.warning-text {
  color: #9a6417 !important;
  font-weight: 700;
}

.role-card-actions,
.role-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.role-card-actions button,
.role-action-row button {
  min-height: 44px;
  padding-right: 8px;
  padding-left: 8px;
}

.employee-card-actions button,
.employee-toolbar button,
.permission-toolbar button {
  min-height: 44px;
}

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

.role-summary-card,
.hint-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.employee-owner-list,
.employee-list {
  display: grid;
  gap: 10px;
}

.employee-owner-list {
  margin-bottom: 10px;
}

.employee-owner-list .card,
.employee-list .card {
  margin-bottom: 0;
}

.employee-owner-card {
  border: 1px solid #d9bd72;
  border-left: 4px solid var(--accent);
  background: var(--panel);
}

.employee-owner-card .card-row,
.employee-card .card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.employee-owner-card .card-row > div,
.employee-card .card-row > div {
  min-width: 0;
}

.employee-owner-card h3,
.employee-card h3,
.employee-card p {
  overflow-wrap: anywhere;
}

.employee-owner-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #fff1c9;
  color: #76520e;
  font-size: 12px;
  font-weight: 800;
}

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

.role-permission-grid {
  gap: 12px;
}

.role-permission-card {
  padding: 12px;
  background: var(--panel);
}

.permission-card-head {
  margin-bottom: 10px;
  align-items: center;
}

.permission-card-head b {
  margin: 0;
  font-size: 16px;
}

.permission-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-check-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-check {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.permission-check.active {
  border-color: rgba(44, 122, 111, 0.45);
  background: #eef7f4;
  color: var(--brand);
}

@media (min-width: 720px) {
  .role-toolbar {
    grid-template-columns: auto minmax(0, 1fr) 150px;
    align-items: center;
  }

  .employee-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
  }

  .employee-toolbar > :is(button, input) {
    grid-column: 1 / -1;
  }
}

.sticky-actions {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.order-box {
  border: 1px dashed #9dc6bd;
  border-radius: 8px;
  background: #eef7f4;
  padding: 10px;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-height: 160px;
  align-items: center;
  text-align: center;
}

.module-tabs {
  position: sticky;
  top: 64px;
  z-index: 8;
  padding-top: 2px;
  background: var(--bg);
}

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

.summary-cell {
  display: grid;
  gap: 4px;
  min-height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-cell b {
  color: var(--accent);
  font-size: 22px;
}

.summary-cell span,
.hint-text {
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

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

.product-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.product-summary-button {
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.product-summary-button b {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 20px;
}

.product-summary-button.selected {
  border-color: var(--brand);
  background: #edf6f3;
  color: var(--brand);
}

.product-filter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.product-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.product-filter-toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.product-primary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.product-card {
  padding: 14px;
}

.product-card.selected {
  border-color: var(--brand);
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.product-select {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.product-select input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
}

.product-card-price {
  display: block;
  margin: 10px 0 6px 30px;
  color: var(--ink);
  font-size: 18px;
}

.product-attribute-line,
.product-card-code {
  margin: 4px 0 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.product-action-sheet .danger-action {
  color: var(--danger);
}

.product-sheet-head {
  padding: 4px 12px 12px;
}

.product-sheet-head h2 {
  margin: 0;
  font-size: 17px;
}

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

.sort-hint {
  margin: 0 0 10px;
}

.sort-panel {
  display: grid;
  gap: 12px;
}

.sort-panel-title {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: baseline;
}

.sort-panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.sort-list.sorting {
  user-select: none;
}

.sort-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(25, 32, 31, 0.05);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.sort-row.dragging {
  position: relative;
  z-index: 5;
  border-color: var(--brand-2);
  box-shadow: 0 16px 30px rgba(22, 63, 58, 0.22);
  transform: scale(1.015);
}

.sort-handle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand);
  font-size: 19px;
  font-weight: 900;
  touch-action: none;
  cursor: grab;
}

.sort-row.dragging .sort-handle {
  cursor: grabbing;
}

.sort-row h3 {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.sort-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.shortcut-row {
  grid-template-columns: 42px minmax(0, 1fr) 82px;
}

.shortcut-row .secondary-btn {
  border-color: #b8d8d1;
  background: #edf7f4;
  color: var(--brand);
}

.shortcut-options {
  display: grid;
  gap: 8px;
}

.shortcut-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.shortcut-option h3 {
  margin: 0;
  font-size: 15px;
}

.shortcut-option p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.store-logo-preview {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--brand);
  font-size: 24px;
  font-weight: 800;
  overflow: hidden;
}

.store-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-profile-view textarea {
  min-height: 78px;
}

.sort-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.select-line {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.meta-grid span {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.meta-grid b {
  color: var(--ink);
}

.compact-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-row span {
  font-weight: 800;
}

.mini-row small {
  color: var(--muted);
  line-height: 1.35;
}

.mini-row b {
  margin-left: 4px;
  color: var(--accent);
  font-size: 12px;
}

.checkbox-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.label-workbench {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.label-print-page {
  display: grid;
  gap: 12px;
  padding-bottom: 92px;
}

.kuaimai-printer-status {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.kuaimai-printer-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent);
  font-weight: 800;
}

.kuaimai-printer-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.kuaimai-printer-copy strong,
.kuaimai-printer-copy small,
.kuaimai-printer-copy p {
  overflow-wrap: anywhere;
}

.kuaimai-printer-copy small,
.kuaimai-printer-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.kuaimai-printer-copy .kuaimai-print-job-status {
  display: flex;
  align-items: center;
  min-height: 16px;
  font-weight: 700;
}

.kuaimai-printer-copy .kuaimai-print-job-status.success {
  color: var(--green);
}

.kuaimai-printer-copy .kuaimai-print-job-status.failure {
  color: var(--danger);
}

.kuaimai-printer-copy .kuaimai-print-job-status.pending {
  color: var(--muted);
}

.kuaimai-printer-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.kuaimai-printer-actions button {
  min-width: 0;
}

.label-size-segments {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.label-size-segments button,
.label-category-segments button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.label-size-segments button.active,
.label-category-segments button.active {
  border-color: var(--accent);
  background: var(--panel-soft);
  color: var(--accent);
  font-weight: 800;
}

.label-product-toolbar,
.label-product-list {
  display: grid;
  gap: 8px;
}

.label-product-toolbar input {
  width: 100%;
  min-width: 0;
}

.label-category-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.label-product-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.label-product-row.selected {
  grid-template-columns: 24px minmax(0, 1fr);
}

.label-product-check {
  display: grid;
  place-items: center;
}

.label-product-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.label-product-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.label-product-copy strong,
.label-product-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.label-product-copy small {
  color: var(--muted);
  font-size: 12px;
}

.label-product-row button {
  min-width: 0;
}

.label-product-actions {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.label-product-row.selected .label-product-actions {
  grid-column: 2;
  grid-row: 2;
  justify-content: space-between;
}

.label-print-quantity {
  display: grid;
  grid-template-columns: 36px 52px 36px;
  gap: 4px;
  align-items: center;
  flex: 0 0 auto;
}

.label-print-quantity button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.label-print-quantity input {
  width: 52px;
  min-width: 52px;
  min-height: 36px;
  margin: 0;
  padding: 6px 3px;
  text-align: center;
}

.label-preview-panel {
  min-width: 0;
}

.label-print-bottom-bar {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(18, 75, 67, 0.14);
}

.label-print-bottom-bar button {
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .kuaimai-printer-status {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .kuaimai-printer-icon {
    width: 36px;
    height: 36px;
  }

  .kuaimai-printer-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.label-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #9dc6bd;
  border-radius: 8px;
  background: #eef7f4;
}

.label-preview.empty {
  min-height: 130px;
  place-items: center;
  color: var(--muted);
}

.label-preview small {
  color: var(--brand);
  font-weight: 800;
}

.print-template-page {
  display: grid;
  gap: 12px;
}

.print-template-page > .form-card {
  min-width: 0;
}

.print-template-page .template-preview {
  max-width: 100%;
  min-width: 0;
}

.print-template-page button {
  min-height: 44px;
}

.print-template-page .ghost-btn.compact {
  min-height: 44px;
}

.print-template-tabs .segmented {
  margin: 0;
}

.print-template-tabs .segmented button {
  min-height: 44px;
}

.print-template-device {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.print-template-device-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.print-template-device-copy :is(small, span) {
  overflow-wrap: anywhere;
}

.print-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 420px) {
  .print-template-device {
    grid-template-columns: minmax(0, 1fr);
  }

  .print-template-device > button {
    width: 100%;
  }

  .print-template-page .template-preview .print-paper {
    width: 100%;
    min-width: 0;
    padding: 18px 10px;
  }

  .print-template-page .template-preview .print-paper table {
    table-layout: fixed;
    font-size: 12px;
  }

  .print-template-page .template-preview .print-paper :is(th, td) {
    padding: 5px 2px;
  }
}

.label-paper {
  display: grid;
  gap: 5px;
  max-width: 260px;
  min-height: 138px;
  padding: 14px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #fff;
  color: #111;
}

.label-paper b {
  font-size: 16px;
}

.label-paper span {
  font-size: 12px;
}

.label-paper strong {
  font-size: 14px;
  letter-spacing: 0;
}

.barcode {
  display: grid;
  place-items: center;
  min-height: 34px;
  margin-top: 4px;
  background:
    repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px),
    #fff;
  color: transparent;
  overflow: hidden;
}

.product-label-paper {
  width: min(100%, 188px);
  aspect-ratio: 34 / 76;
  grid-template-rows: auto auto minmax(42px, 1fr) auto auto;
  place-items: center;
  gap: 6px;
  min-height: 420px;
  max-width: 188px;
  padding: 34px 12px 12px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  text-align: center;
}

.label-store {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.label-name {
  max-width: 100%;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.label-spec {
  justify-self: start;
  align-self: end;
  display: grid;
  gap: 1px;
  text-align: left;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.label-qr {
  width: 128px;
  height: 128px;
  object-fit: contain;
  image-rendering: pixelated;
}

.label-code {
  max-width: 100%;
  color: #111 !important;
  font-size: 8px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-label-canvas-wrap {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 100%;
  overflow-x: auto;
}

.product-label-canvas {
  position: relative;
  width: min(100%, 360px);
  min-width: 280px;
  border: 1px solid #111;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  overflow: hidden;
  touch-action: none;
}

.product-label-canvas.with-guides {
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.03) 0 1px, transparent 1px),
    #fff;
}

.label-paper-artwork {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.label-paper-artwork-72x30 {
  top: 0;
  bottom: 0;
  left: 23.6111%;
  width: 6.25%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f49a16;
  color: #111;
}

.label-paper-artwork-72x30 b {
  display: block;
  width: 666.6667%;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transform: rotate(90deg);
}

.label-field {
  position: absolute;
  display: flex;
  align-items: center;
  min-width: 8px;
  min-height: 6px;
  padding: 1px;
  line-height: 1.12;
  overflow: hidden;
  overflow-wrap: anywhere;
  user-select: none;
  z-index: 3;
}

.label-field.selected {
  outline: 2px solid #2f95e8;
  background: rgba(47, 149, 232, 0.08);
}

.label-field.is-hidden {
  opacity: 0.3;
}

.label-field-qr {
  display: grid;
  place-items: center;
  padding: 0;
  background: #fff;
}

.label-qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.label-field-qr small,
.label-field-barcode small {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  background: #fff;
  font-size: 7px;
  text-align: center;
  white-space: nowrap;
}

.label-barcode {
  display: block;
  width: 100%;
  height: 70%;
  background:
    repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px),
    #fff;
  color: transparent;
}

.label-line {
  width: 100%;
  border-top: 1.5px solid #111;
}

.label-guide,
.label-safe-area {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.label-guide b,
.label-safe-area b {
  position: absolute;
  top: 2px;
  left: 3px;
  padding: 1px 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  color: #41504c;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.guide-left {
  border-left: 1px dashed #2f95e8;
}

.guide-main {
  border-right: 1px dashed #31a66a;
  border-left: 1px dashed #31a66a;
  background: rgba(49, 166, 106, 0.05);
}

.guide-tail {
  border-left: 1px dashed #d66b4d;
  background: rgba(214, 107, 77, 0.04);
}

.guide-glue {
  background: rgba(200, 70, 70, 0.12);
}

.guide-72-qr {
  border-left: 1px dashed #2f95e8;
}

.guide-72-info {
  border-right: 1px dashed #31a66a;
  border-left: 1px dashed #31a66a;
  background: rgba(49, 166, 106, 0.05);
}

.guide-72-tail,
.guide-72-no-glue,
.guide-72-neck {
  top: 50%;
  bottom: auto;
  height: 26.6667%;
  transform: translateY(-50%);
}

.guide-72-tail {
  border-left: 1px dashed #d66b4d;
  background: rgba(214, 107, 77, 0.04);
}

.guide-72-no-glue {
  background: rgba(200, 70, 70, 0.12);
}

.guide-72-neck {
  border: 1px dashed #d66b4d;
  background: rgba(214, 107, 77, 0.08);
}

.label-safe-area {
  inset: 6% 6%;
  border: 1px dotted rgba(17, 17, 17, 0.38);
}

.label-safe-area b {
  top: auto;
  bottom: 2px;
}

.mini-label-warning {
  margin: 0;
  color: #9a6417;
  font-size: 12px;
  font-weight: 800;
}

.label-editor-head,
.label-editor-stage,
.label-editor-panel,
.label-field-library {
  display: grid;
  gap: 12px;
}

.selected-field-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.selected-field-title b {
  color: var(--ink);
  font-size: 15px;
}

.label-stepper-grid,
.label-align-row,
.field-chip-grid {
  display: grid;
  gap: 8px;
}

.label-stepper-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.label-align-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.label-stepper-grid button,
.label-align-row button,
.field-chip-grid button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 800;
}

.label-align-row button.active {
  border-color: rgba(44, 122, 111, 0.55);
  background: #eef7f4;
  color: var(--brand);
}

.scan-cell {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--brand-2);
  font-weight: 800;
}

.sales-screen {
  background: #eef3f7;
}

.sales-screen .topbar {
  background: #2f95e8;
}

.sales-content {
  padding: 10px;
}

.sales-meta {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #d8e0e6;
  border-radius: 8px;
  background: #fff;
}

.sales-meta input {
  font-size: 17px;
  font-weight: 700;
}

.date-field {
  position: relative;
}

.date-field input {
  padding-right: 42px;
}

.date-field span {
  position: absolute;
  right: 12px;
  bottom: 11px;
  color: #111;
  font-size: 22px;
}

.sales-lines {
  display: grid;
  gap: 12px;
}

.pair-card {
  position: relative;
  padding: 16px 10px 10px;
  border: 1px dashed #48aee5;
  border-radius: 8px;
  background: #eef8ff;
}

.pair-badge {
  position: absolute;
  top: -1px;
  left: -1px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #2f95e8;
  color: #fff;
  font-weight: 800;
}

.pair-slot-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.product-slot {
  display: grid;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(84, 174, 226, 0.18);
}

.product-slot:last-child {
  border-bottom: 0;
}

.slot-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 82px;
  text-align: center;
}

.slot-icon,
.slot-add,
.ghost-icon-btn,
.delete-icon-btn {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #2f95e8;
  font-weight: 800;
}

.slot-icon {
  color: #2f95e8;
  font-size: 24px;
  font-weight: 900;
}

.slot-add {
  font-size: 40px;
}

.slot-empty {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #8ba0ad;
  font-size: 14px;
}

.slot-detail {
  display: grid;
  gap: 9px;
}

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

.slot-title-row h3 {
  margin: 0;
  font-size: 17px;
}

.slot-title-row button {
  border: 0;
  background: transparent;
  color: #2f95e8;
  font-weight: 800;
}

.slot-spec {
  margin: 0;
  color: #758692;
}

.lens-power,
.slot-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  color: #738491;
  font-weight: 700;
}

.lens-power input,
.slot-note input,
.editable-amount input {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  padding: 6px 10px;
}

.slot-price-row,
.slot-buttons,
.pair-footer,
.sales-bottom,
.sales-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.slot-price-row,
.pair-footer,
.sales-bottom {
  justify-content: space-between;
}

.discount {
  padding: 9px 16px;
  border-radius: 6px;
  background: #fff0c9;
  color: #c68d20;
  font-weight: 800;
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 36px 42px 36px;
  align-items: center;
  text-align: center;
}

.qty-control button,
.qty-control input {
  min-height: 34px;
  border: 0;
  background: #edf0f2;
  color: #111;
  text-align: center;
}

.slot-amount {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  font-weight: 800;
}

.slot-amount input,
.pair-footer b,
.receivable b {
  color: #d3212b;
  font-size: 21px;
}

.slot-amount input {
  width: 112px;
  text-align: right;
  font-weight: 800;
}

.slot-buttons {
  justify-content: flex-end;
}

.slot-buttons.single {
  justify-content: flex-end;
}

.pair-footer {
  padding-top: 10px;
  border-top: 1px dashed rgba(72, 174, 229, 0.45);
  font-size: 16px;
  font-weight: 800;
}

.ghost-icon-btn,
.delete-icon-btn {
  width: 38px;
  height: 38px;
  font-size: 30px;
}

.delete-icon-btn {
  color: #cf2d4b;
}

.sales-bottom {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin: 12px -10px -10px;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #d6e1e8;
  background: rgba(255, 255, 255, 0.96);
}

.receivable {
  font-size: 18px;
  font-weight: 800;
}

.sales-bottom-actions .primary-btn {
  min-width: 104px;
  background: #2f95e8;
}

.cashier-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 8px;
}

.cashier-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  min-height: 92px;
  border-radius: 8px;
  overflow: hidden;
  background: #ededed;
}

.cashier-icons button {
  border: 0;
  background: #f7f7f7;
  color: #2f95e8;
  font-size: 38px;
  font-weight: 800;
}

.cashier-summary,
.cashier-rows,
.order-extra,
.delivery-row,
.processing-row {
  border-radius: 4px;
  background: #fff;
}

.cashier-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #e6e8ea;
  font-size: 17px;
}

.cashier-summary b,
.cashier-rows b {
  color: #d3212b;
  font-weight: 800;
}

.cashier-summary label {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  justify-self: end;
  font-size: 20px;
}

.cashier-summary input {
  width: 170px;
  min-height: 44px;
  border: 1px solid #e5e5e5;
  text-align: center;
  font-size: 20px;
}

.cashier-rows {
  display: grid;
  padding: 14px;
}

.cashier-rows > div,
.cashier-rows > button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  text-align: left;
}

.cashier-rows > *:last-child {
  border-bottom: 0;
}

.order-extra {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.order-remark {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  font-size: 18px;
}

.order-remark textarea {
  min-height: 94px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
}

.attachment-row {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 18px;
}

.attachment-thumb {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 4px;
  background: #f0f0f0;
  color: #c7c7c7;
  font-size: 26px;
}

.attachment-thumb b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2f95e8;
  color: #fff;
  font-size: 15px;
}

.hidden-file {
  display: none;
}

.delivery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 14px;
  font-size: 17px;
}

.delivery-row label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.processing-row {
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 14px;
  border: 0;
  color: var(--ink);
  font-size: 18px;
}

.sales-meta small {
  display: block;
  margin-top: 6px;
  color: #7d8a92;
  font-size: 12px;
}

.sales-scan-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed #62afe7;
  border-radius: 8px;
  background: #f7fcff;
  color: #7d8a92;
  font-weight: 800;
  text-align: center;
}

.compact-pair-card {
  padding: 12px 10px 10px;
  background: #f1f9ff;
}

.pair-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding-left: 24px;
}

.pair-head strong {
  font-size: 16px;
}

.pair-head span {
  font-weight: 800;
}

.pair-head b,
.slot-line-footer b {
  color: #d3212b;
}

.pair-head .delete-icon-btn {
  width: auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #efb7b7;
  border-radius: 6px;
  background: #fff8f8;
  font-size: 14px;
}

.compact-slot-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.add-after-pair-btn {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border: 1px dashed #2f95e8;
  border-radius: 8px;
  background: #fff;
  color: #2f95e8;
  font-size: 15px;
  font-weight: 900;
}

.add-after-pair-btn:active {
  background: #eaf6ff;
}

.compact-slot-row {
  display: grid;
  gap: 7px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.compact-slot-row.empty {
  padding: 0;
  background: transparent;
}

.slot-select-button {
  display: grid;
  gap: 2px;
  justify-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #d5e7f7;
  border-radius: 8px;
  background: #fff;
  color: #2f95e8;
}

.slot-select-button strong {
  font-size: 16px;
  font-weight: 900;
}

.slot-select-button small {
  color: #7b8b95;
  font-size: 12px;
}

.slot-product-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: var(--ink);
}

.slot-product-summary span {
  color: #2f95e8;
  font-size: 13px;
  font-weight: 900;
}

.slot-product-summary strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.slot-price-edit {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #d3212b;
  font-weight: 900;
}

.slot-price-edit input {
  width: 82px;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: #fff;
  color: #d3212b;
  text-align: right;
  font-size: 17px;
  font-weight: 900;
}

.slot-line-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.slot-line-footer span {
  justify-self: end;
  font-size: 14px;
  font-weight: 800;
}

.slot-change-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d5e7f7;
  border-radius: 6px;
  background: #fff;
  color: #2f95e8;
  font-weight: 900;
}

.slot-line-footer .qty-control {
  grid-template-columns: 30px 38px 30px;
}

.slot-line-footer .qty-control button,
.slot-line-footer .qty-control input {
  min-height: 30px;
}

.cashier-panel {
  gap: 8px;
  margin-top: 10px;
}

.cashier-summary,
.cashier-rows {
  border-radius: 8px;
}

.cashier-summary {
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  font-size: 15px;
}

.cashier-summary label {
  grid-column: 1 / -1;
  justify-self: stretch;
  font-size: 17px;
}

.cashier-summary input {
  width: 100%;
  min-height: 38px;
}

.cashier-rows {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
}

.cashier-rows > div {
  display: grid;
  gap: 3px;
  min-height: auto;
  padding: 9px;
  border: 0;
  background: #fff;
  font-size: 14px;
}

.printer-test-row {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.printer-test-row small {
  color: #7d8a92;
  line-height: 1.5;
}

.sales-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.sales-bottom-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.sales-bottom-actions .secondary-btn,
.sales-bottom-actions .primary-btn {
  min-height: 44px;
  min-width: 0;
  font-size: 17px;
}

.action-sheet {
  display: grid;
  gap: 0;
  padding: 0 0 calc(8px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.action-sheet button {
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  color: #111;
  font-size: 18px;
}

.action-sheet .danger-action {
  background: #fff4f2;
  color: var(--danger);
  border-bottom-color: #f1c7bf;
}

.action-sheet .danger-action:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.action-sheet button:last-child {
  margin-top: 8px;
  border-bottom: 0;
}

.product-picker {
  margin: -10px -10px 0;
}

.picker-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 10px;
  background: #2f95e8;
}

.picker-search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  text-align: center;
  font-size: 17px;
}

.picker-filter-bar {
  display: grid;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid #d7dee4;
  background: #fff;
}

.picker-filter-bar.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.picker-filter-bar.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.picker-filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: #33413f;
  font-size: 16px;
  font-weight: 800;
}

.picker-filter-bar button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-filter-bar button b {
  color: inherit;
  font-size: 13px;
}

.picker-filter-bar button.active {
  border-color: #dcd5c9;
  background: #fffdfa;
}

.picker-filter-bar button.open {
  color: #ea7145;
}

.picker-dropdown {
  position: relative;
  z-index: 5;
  padding: 14px 16px 18px;
  border-bottom: 1px solid #ebeef0;
  background: #fff;
  box-shadow: 0 10px 22px rgba(29, 42, 51, 0.12);
}

.picker-dropdown h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.picker-dropdown button {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  color: #151f1d;
  text-align: left;
  font-size: 17px;
}

.picker-dropdown button.active {
  color: #0f453c;
  font-weight: 900;
}

.picker-dropdown p {
  margin: 0;
  color: #7d8a92;
}

.picker-results-wrap {
  position: relative;
  min-height: 360px;
}

.picker-results-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
}

.picker-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  transition: opacity 0.16s ease;
}

.picker-list.is-dimmed {
  opacity: 0.72;
}

.picker-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #fff;
}

.picker-thumb {
  display: grid;
  place-items: center;
  width: 68px;
  min-height: 68px;
  background: #e8edf1;
  color: #7c8992;
  font-weight: 800;
}

.picker-main {
  min-width: 0;
}

.picker-item h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.picker-item p {
  margin: 5px 0;
}

.picker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #1c2926;
  font-weight: 700;
}

.picker-code,
.picker-price {
  color: #d95a6a;
  font-weight: 800;
}

.picker-side {
  display: grid;
  justify-items: end;
  gap: 7px;
  font-size: 14px;
}

.picker-side .primary-btn {
  min-height: 44px;
}

.picker-fab {
  position: fixed;
  right: calc(50vw - min(50vw, 215px) + 18px);
  z-index: 22;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #2f95e8;
  color: #fff;
  font-size: 32px;
  box-shadow: 0 12px 28px rgba(47, 149, 232, 0.28);
}

.picker-fab.add {
  bottom: 42px;
}

.print-preview {
  margin: -10px -10px 0;
  padding: 12px;
  background: #eef1f3;
}

.a5-canvas-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 1184 / 1680;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d8dde0;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.a5-canvas-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.a5-canvas-preview.is-error {
  padding: 24px;
  color: var(--danger);
  text-align: center;
}

.print-paper {
  min-height: 620px;
  padding: 36px 28px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", "Songti SC", serif;
}

.receipt-paper {
  min-height: 560px;
  padding: 38px 28px 32px;
  font-family: "Songti SC", "SimSun", "PingFang SC", serif;
}

.print-paper h2,
.print-paper h3 {
  margin: 0;
  text-align: center;
}

.print-paper h2 {
  font-size: 22px;
}

.print-paper h3 {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 500;
}

.print-line {
  height: 1px;
  margin: 14px 0;
  background: #111;
}

.print-meta,
.print-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.print-paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: center;
}

.print-paper th,
.print-paper td {
  padding: 7px 5px;
  border: 1px solid #111;
  line-height: 1.35;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.print-paper th:nth-child(1),
.print-paper td:nth-child(1) {
  width: 10%;
}

.print-paper th:nth-child(2),
.print-paper td:nth-child(2),
.print-paper th:nth-child(4),
.print-paper td:nth-child(4) {
  width: 32%;
}

.print-paper th:nth-child(3),
.print-paper td:nth-child(3),
.print-paper th:nth-child(5),
.print-paper td:nth-child(5) {
  width: 13%;
  white-space: nowrap;
}

.print-remark {
  margin: 18px 0 46px;
  font-size: 18px;
  font-weight: 800;
}

.receipt-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-height: 150px;
  padding-top: 18px;
}

.print-total {
  display: grid;
  justify-content: end;
  min-width: 138px;
  font-size: 16px;
  font-weight: 700;
}

.print-total p {
  margin: 4px 0;
}

.receipt-no {
  margin-top: 12px !important;
  color: #333;
  font-size: 12px;
  font-weight: 500;
}

.receipt-remark-field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: #34413d;
  font-size: 14px;
  font-weight: 800;
}

.receipt-remark-field textarea {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
}

.template-preview {
  margin: 12px 0 0;
  padding: 0;
  overflow: auto;
}

.template-preview .print-paper {
  min-width: 360px;
  min-height: 430px;
  padding: 24px 18px;
}

.print-setting-card {
  display: grid;
  gap: 8px;
}

.print-controls {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.print-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.print-control-row span {
  width: 54px;
  color: #6b777e;
  font-weight: 800;
}

.print-control-row button {
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: #f4f6f8;
  color: #6c747b;
}

.print-control-row button.active {
  background: #2f95e8;
  color: #fff;
}

.printer-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 6px 12px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: #f4f6f9;
  color: #1f2a30;
  text-align: left;
}

.printer-card span {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  border: 1px solid #8a9298;
  border-radius: 50%;
}

.printer-card.connected span {
  border-color: #2f95e8;
  background: #2f95e8;
}

.printer-card small {
  color: #909ba3;
}

.printer-card em {
  grid-row: span 2;
  color: #adb6bd;
  font-style: normal;
  font-size: 24px;
}

.a4se-device-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.a4se-device-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.a4se-device-copy strong,
.a4se-device-copy span,
.a4se-device-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.a4se-device-copy span {
  color: var(--brand);
  font-size: 13px;
}

.a4se-device-copy small {
  color: var(--muted);
}

.a4se-device-bar .ghost-btn.compact {
  min-width: 104px;
  min-height: 44px;
}

.a4se-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 31, 28, 0.42);
}

.a4se-picker-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 430px);
  max-height: min(78vh, 640px);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: var(--panel);
  box-shadow: 0 -12px 30px rgba(24, 44, 39, 0.16);
}

.a4se-picker-sheet header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.a4se-picker-sheet header h2,
.a4se-picker-sheet header p {
  margin: 0;
}

.a4se-picker-sheet header h2 {
  font-size: 18px;
}

.a4se-picker-sheet header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.a4se-picker-sheet header button {
  min-width: 44px;
  min-height: 44px;
}

.a4se-device-list {
  min-height: 120px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.a4se-device-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 68px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.a4se-device-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.a4se-device-row strong,
.a4se-device-row span,
.a4se-device-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.a4se-device-row small,
.a4se-device-row span {
  color: var(--muted);
  font-size: 12px;
}

.a4se-device-row button {
  min-width: 68px;
  min-height: 44px;
}

.a4se-signal {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 24px;
  height: 20px;
}

.a4se-signal i {
  width: 4px;
  border-radius: 1px;
  background: var(--brand);
  opacity: 0.22;
}

.a4se-signal i:nth-child(1) {
  height: 6px;
}

.a4se-signal i:nth-child(2) {
  height: 11px;
}

.a4se-signal i:nth-child(3) {
  height: 16px;
}

.a4se-signal.weak i:nth-child(1),
.a4se-signal.medium i:nth-child(-n + 2),
.a4se-signal.strong i {
  opacity: 1;
}

.a4se-picker-sheet footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.a4se-picker-sheet footer button {
  min-height: 44px;
}

@media (max-width: 420px) {
  .a4se-device-bar {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
  }

  .a4se-device-bar .ghost-btn.compact {
    min-width: 0;
    padding-inline: 10px;
  }

  .a4se-device-row {
    grid-template-columns: 24px minmax(0, 1fr) 64px;
    padding-inline: 12px;
  }

  .a4se-device-row button {
    min-width: 0;
    padding-inline: 8px;
  }
}

.print-btn {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: #2f95e8;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.print-btn:disabled {
  background: #d9d9d9;
  color: rgba(255, 255, 255, 0.72);
}

.totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.total-line {
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.total-line b {
  color: var(--accent);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.empty-state::before {
  content: "";
  display: block;
  width: 68px;
  height: 48px;
  margin-bottom: 12px;
  border: 2px solid #d7d1c6;
  border-radius: 8px;
  background: linear-gradient(#fff, #f3efe7);
}

.mine-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.mine-avatar {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  place-items: center;
  background: rgba(18, 75, 67, 0.1);
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
}

.mine-profile-copy {
  min-width: 0;
}

.mine-profile-copy h2 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.mine-profile-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mine-menu {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.mine-menu-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.mine-menu-row:last-child {
  border-bottom: 0;
}

.mine-menu-icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  place-items: center;
  background: rgba(18, 75, 67, 0.08);
  color: var(--brand);
}

.mine-menu-icon .lucide-icon {
  width: 19px;
  height: 19px;
}

.mine-menu-copy {
  min-width: 0;
}

.mine-menu-copy strong,
.mine-menu-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.mine-menu-copy strong {
  font-size: 15px;
}

.mine-menu-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mine-menu-arrow {
  color: var(--muted);
  font-size: 20px;
}

.mine-logout-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border: 1px solid rgba(200, 70, 70, 0.28);
  border-radius: 12px;
  background: var(--panel);
  color: var(--danger);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  width: min(100%, 430px);
  margin: 0 auto;
  background: rgba(25, 32, 31, 0.45);
}

.sheet {
  border-radius: 18px 18px 0 0;
  background: #fff;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
}

.quick-listing-sheet {
  max-height: min(82vh, 720px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  padding: 0;
}

.quick-listing-sheet header,
.quick-listing-sheet footer {
  padding: 14px 16px;
}

.quick-listing-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.quick-listing-sheet header h2 {
  margin: 0;
  font-size: 18px;
}

.quick-listing-sheet header button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.quick-listing-fields {
  overflow-y: auto;
  padding: 0 16px 12px;
}

.quick-listing-fields .field {
  margin-top: 12px;
}

.quick-listing-sheet > .text-btn {
  min-height: 44px;
  margin: 0 16px;
  border: 0;
  background: transparent;
  color: var(--primary);
  text-align: left;
}

.quick-listing-sheet footer {
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.quick-listing-sheet footer .primary-btn {
  width: 100%;
  min-height: 48px;
}

.modal-backdrop:has(.product-create-modal) {
  align-items: center;
  padding: 20px;
}

.product-create-modal {
  width: 100%;
  max-width: 390px;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 42px rgba(25, 32, 31, 0.22);
}

.order-detail-head .status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.amount-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(28, 47, 43, 0.06);
}

.amount-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.amount-panel b {
  color: var(--ink);
  font-size: 18px;
}

.amount-panel .paid-row {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.amount-panel .paid-row b {
  color: var(--accent);
  font-size: 22px;
}

.paid-amount-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px dashed rgba(214, 107, 77, 0.42);
  border-radius: 8px;
  background: #fff7f4;
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

.paid-amount-button span {
  color: var(--accent);
  font-size: 13px;
}

.order-paid-line {
  display: flex;
  align-items: center;
  gap: 0;
}

.list-paid-amount {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px dashed rgba(214, 107, 77, 0.55);
  border-radius: 6px;
  background: #fff7f4;
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.list-paid-amount span {
  color: var(--accent);
  font-size: 12px;
}

.list-price-sheet {
  max-height: 82vh;
  overflow: auto;
}

.list-price-summary {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.list-price-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.list-price-summary b {
  font-size: 18px;
}

.inline-price-editor {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  width: min(100%, 260px);
}

.inline-price-editor label {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(214, 107, 77, 0.45);
  border-radius: 8px;
  background: #fff7f4;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
}

.inline-price-editor input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}

.inline-price-actions {
  display: flex;
  gap: 4px;
}

.icon-btn.small {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 17px;
}

.inline-price-reason {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.order-line-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-line-card:last-child {
  border-bottom: 0;
}

.order-line-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.order-line-card p,
.price-log-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.order-line-card b {
  display: block;
  margin-top: 6px;
}

.price-log summary {
  cursor: pointer;
  font-weight: 800;
}

.price-log-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.qr {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  margin: 12px auto;
  border: 10px solid #f4efe6;
  background:
    repeating-linear-gradient(45deg, #163f3a 0 5px, transparent 5px 11px),
    #fff;
  color: var(--brand);
  font-weight: 900;
}

.notice {
  position: fixed;
  right: calc(50vw - min(50vw, 215px) + 14px);
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: calc(50vw - min(50vw, 215px) + 14px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(22, 63, 58, 0.96);
  color: #fff;
  box-shadow: 0 14px 28px rgba(22, 63, 58, 0.24);
}

.notice span {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.notice button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 10px;
}

.toolbar .primary-btn,
.toolbar .secondary-btn,
.toolbar .danger-btn {
  flex: 0 1 auto;
}

/* Report dashboard prototype: one primary revenue metric, then progressive detail. */
.report-dashboard {
  padding: 2px 0 0;
}

.report-dashboard button {
  font: inherit;
}

.report-dashboard-date-range {
  margin-bottom: 18px;
}

.report-dashboard-date-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #d8e4df;
  border-radius: 12px;
  background: var(--panel);
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.report-dashboard-date-trigger span {
  font-size: 20px;
  line-height: 1;
}

.report-dashboard-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-top: 9px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.report-dashboard-chips::-webkit-scrollbar {
  display: none;
}

.report-dashboard-chips button,
.report-dashboard-toggle button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #e9f0ed;
  color: #60736d;
  font-size: 12px;
  font-weight: 700;
}

.report-dashboard-chips button.active,
.report-dashboard-toggle button.active {
  background: var(--brand);
  color: #fff;
}

.report-dashboard-overview {
  margin-bottom: 22px;
}

.report-dashboard-heading {
  margin-bottom: 10px;
}

.report-dashboard-heading span {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.report-dashboard-heading h2,
.report-dashboard-section-title h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.report-dashboard-hero {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #124b43, #2c7067);
  color: #fff;
  box-shadow: 0 14px 28px rgba(18, 75, 67, 0.18);
}

.report-dashboard-hero small {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.report-dashboard-hero strong {
  display: block;
  margin: 5px 0 14px;
  font-size: 34px;
  letter-spacing: -1.2px;
  line-height: 1;
}

.report-dashboard-hero > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.report-dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.report-dashboard-summary-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e3ebe7;
  border-radius: 14px;
  background: var(--panel);
}

.report-dashboard-summary-grid small,
.report-dashboard-business-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.report-dashboard-summary-grid b {
  display: block;
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.report-dashboard-summary-grid span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-dashboard-section {
  margin-top: 24px;
}

.report-dashboard-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
}

.report-dashboard-section-title h2 {
  margin: 0;
  font-size: 18px;
}

.report-dashboard-section-title > span {
  color: var(--muted);
  font-size: 12px;
}

.report-dashboard-toggle {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.report-dashboard-toggle::-webkit-scrollbar {
  display: none;
}

.report-dashboard-toggle button {
  min-height: 44px;
  padding: 0 8px;
  font-size: 11px;
}

.report-dashboard-business-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}

.report-dashboard-business-grid > div {
  min-width: 0;
  min-height: 82px;
  padding: 14px;
  border-right: 1px solid #edf0ee;
  border-bottom: 1px solid #edf0ee;
}

.report-dashboard-business-grid > div:nth-child(2n) {
  border-right: 0;
}

.report-dashboard-business-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.report-dashboard-business-grid b {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.report-dashboard-business-grid > div:nth-child(1) b,
.report-dashboard-business-grid > div:nth-child(4) b {
  color: var(--accent);
}

.report-dashboard-trend-chart {
  position: relative;
  min-height: 180px;
  overflow: visible;
  border: 1px solid #e3ebe7;
  border-radius: 15px;
  background:
    linear-gradient(#edf1ef 1px, transparent 1px) 0 28px / 100% 40px,
    var(--panel);
}

.report-dashboard-trend-line {
  position: absolute;
  right: 18px;
  bottom: 42px;
  left: 18px;
  height: 105px;
  border-bottom: 2px solid #62a18e;
  background: linear-gradient(154deg, transparent 45%, #62a18e 46%, #62a18e 49%, transparent 50%) 0 25px / 58px 54px repeat-x;
  clip-path: polygon(0 78%, 13% 55%, 26% 64%, 42% 26%, 58% 48%, 74% 18%, 87% 38%, 100% 3%, 100% 100%, 0 100%);
  opacity: 0.95;
}

.report-dashboard-trend-labels {
  position: absolute;
  right: 18px;
  bottom: 15px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  color: #8b9893;
  font-size: 11px;
}

.report-dashboard-trend-labels span {
  white-space: nowrap;
}

.report-dashboard-rank-head,
.report-dashboard-rank-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 30px;
  gap: 8px;
  align-items: center;
}

.report-dashboard-rank-head {
  padding: 0 12px 7px;
  color: var(--muted);
  font-size: 11px;
}

.report-dashboard-rank-list,
.report-dashboard-product-list {
  overflow: hidden;
  border: 1px solid #e3ebe7;
  border-radius: 15px;
  background: var(--panel);
}

.report-dashboard-rank-row {
  width: 100%;
  min-height: 57px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.report-dashboard-rank-row:last-child,
.report-dashboard-product-row:last-child {
  border-bottom: 0;
}

.report-dashboard-rank-row > span:first-child {
  font-size: 17px;
}

.report-dashboard-rank-row b,
.report-dashboard-product-row b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-dashboard-rank-row strong,
.report-dashboard-product-row strong {
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}

.report-dashboard-rank-row > span:last-child {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.report-dashboard-product-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 53px;
  padding: 0 13px;
  border-bottom: 1px solid #edf0ee;
}

.report-dashboard-product-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-dashboard-bottom-space {
  min-height: 86px;
}

.report-source-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.report-source-filter button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: #edf4f1;
  color: #61736d;
  font-weight: 700;
}

.report-source-filter button.active {
  background: var(--brand);
  color: #fff;
}

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

.report-reconciliation {
  margin-top: 18px;
}

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

.report-reconciliation-filters small,
.report-reconciliation-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.report-reconciliation-filters select {
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.report-reconciliation-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin-top: 5px;
  scrollbar-width: none;
}

.report-reconciliation-chips::-webkit-scrollbar {
  display: none;
}

.report-reconciliation-chips button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #e9f0ed;
  color: #60736d;
  font-size: 12px;
  font-weight: 700;
}

.report-reconciliation-chips button.active {
  background: var(--brand);
  color: #fff;
}

.report-reconciliation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-reconciliation-list > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e3ebe7;
  border-radius: 12px;
  background: var(--panel);
}

.report-reconciliation-list span,
.report-reconciliation-list b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-reconciliation-list span {
  color: var(--muted);
  font-size: 12px;
}

.report-reconciliation-list b {
  margin: 5px 0 2px;
  color: var(--accent);
  font-size: 18px;
}

.report-dashboard-empty {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

.report-section-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #e6ece9;
}

.report-section-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.report-section-tabs button.active {
  background: var(--panel);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(18, 75, 67, 0.1);
}

.processing-report-page {
  min-width: 0;
}

.processing-report-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3ebe7;
  border-radius: 15px;
  background: var(--panel);
}

.processing-report-controls button,
.processing-report-controls input,
.processing-report-controls select {
  min-height: 44px;
  border: 1px solid #d8e4df;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}

.processing-report-controls button {
  padding: 0 12px;
  font-weight: 800;
}

.processing-report-controls input,
.processing-report-controls select {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

.processing-report-periods {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.processing-report-periods::-webkit-scrollbar {
  display: none;
}

.processing-report-periods button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #e9f0ed;
  color: #60736d;
}

.processing-report-periods button.active {
  background: var(--brand);
  color: #fff;
}

.processing-report-picker,
.processing-report-custom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.processing-report-picker label,
.processing-report-custom label {
  min-width: 0;
}

.processing-report-picker label > span,
.processing-report-custom label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.processing-report-custom {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

.processing-report-status,
.processing-report-range {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.processing-report-stale-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #e8d8a4;
  border-radius: 11px;
  background: #fff8df;
  color: #715a16;
  font-size: 13px;
  font-weight: 800;
}

.processing-report-empty {
  padding: 28px 14px;
  border: 1px dashed #cbd9d4;
  border-radius: 14px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.processing-report-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.processing-report-summary > div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid #e3ebe7;
  border-radius: 13px;
  background: var(--panel);
}

.processing-report-summary small,
.processing-report-summary b {
  display: block;
}

.processing-report-summary small {
  color: var(--muted);
  font-size: 11px;
}

.processing-report-summary b {
  margin-top: 5px;
  color: var(--brand);
  font-size: 22px;
}

.processing-report-rank-list,
.processing-report-days {
  overflow: hidden;
  border: 1px solid #e3ebe7;
  border-radius: 15px;
  background: var(--panel);
}

.processing-report-rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf0ee;
}

.processing-report-rank-row:last-child {
  border-bottom: 0;
}

.processing-report-rank-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.processing-report-rank-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.processing-report-rank-row b {
  color: var(--accent);
  text-align: right;
}

.processing-report-day {
  border-bottom: 1px solid #edf0ee;
}

.processing-report-day:last-child {
  border-bottom: 0;
}

.processing-report-day-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.processing-report-day-toggle span {
  color: var(--muted);
  font-size: 12px;
}

.processing-report-day-toggle b {
  color: var(--brand);
  font-size: 12px;
}

.processing-report-day-entries {
  padding: 0 12px 10px;
  background: var(--panel-soft);
}

.processing-report-day-head,
.processing-report-day-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(72px, 96px));
  gap: 8px;
  align-items: center;
}

.processing-report-day-head {
  padding: 8px 0 5px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.processing-report-day-head span:first-child {
  text-align: left;
}

.processing-report-day-entry {
  min-height: 44px;
  border-top: 1px solid #e6ece9;
}

.processing-report-day-entry strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.processing-report-day-entry span {
  text-align: center;
}

.processing-report-pagination {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  text-align: center;
}

.processing-report-pagination button {
  min-height: 44px;
  border: 1px solid #d8e4df;
  border-radius: 10px;
  background: var(--panel);
  color: var(--brand);
  font-weight: 800;
}

.processing-report-pagination button:disabled,
.processing-report-controls button:disabled {
  cursor: default;
  opacity: 0.45;
}

.report-dashboard-trend-svg {
  position: absolute;
  inset: 24px 18px 42px;
  width: calc(100% - 36px);
  height: 114px;
  overflow: visible;
  color: #4f9482;
}

.report-loading {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.report-loading span {
  display: block;
  height: 78px;
  border-radius: 14px;
  background: linear-gradient(90deg, #edf3f0 20%, #f8faf9 50%, #edf3f0 80%);
  background-size: 220% 100%;
  animation: report-loading 1.35s ease-in-out infinite;
}

@keyframes report-loading {
  to {
    background-position: -120% 0;
  }
}

.report-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #efd7cb;
  border-radius: 12px;
  background: #fff7f2;
  color: #8d4939;
  font-size: 13px;
}

.report-error button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #8d4939;
  color: #fff;
  font-weight: 700;
}

.report-insights {
  display: grid;
  gap: 9px;
}

.report-insight-row {
  padding: 13px 14px;
  border-left: 4px solid #70a797;
  border-radius: 10px;
  background: #eef5f2;
}

.report-insight-row.warning,
.report-insight-row.attention {
  border-left-color: var(--accent);
  background: #fff6f0;
}

.report-insight-row b,
.report-insight-row p {
  display: block;
  margin: 0;
}

.report-insight-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.report-source-summary > div,
.report-source-summary > span {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e3ebe7;
  border-radius: 12px;
  background: var(--panel);
}

.report-source-summary small,
.report-source-summary b,
.report-source-summary span {
  display: block;
}

.report-source-summary small,
.report-source-summary span {
  color: var(--muted);
  font-size: 12px;
}

.report-source-summary b {
  margin: 5px 0;
  color: var(--accent);
  font-size: 18px;
}

.report-staff-group + .report-staff-group {
  margin-top: 18px;
}

.report-staff-group h3 {
  margin: 12px 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.report-assistant {
  padding: 16px;
  border: 1px solid #d8e7e1;
  border-radius: 18px;
  background: linear-gradient(145deg, #f4faf7, #fff);
  box-shadow: 0 10px 24px rgba(22, 77, 68, 0.08);
}

.report-assistant .report-dashboard-section-title {
  align-items: flex-start;
}

.report-assistant .report-dashboard-section-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.report-assistant-history-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfe0da;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.report-assistant-boundary {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.report-assistant-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.report-assistant-prompts::-webkit-scrollbar {
  display: none;
}

.report-assistant-prompts button {
  flex: 0 0 auto;
  max-width: 220px;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #e4f0eb;
  color: #315e54;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.report-assistant-form {
  margin-top: 12px;
}

.report-assistant-form textarea {
  width: 100%;
  min-height: 86px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid #d8e4df;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.report-assistant-form > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.report-assistant-error {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1eb;
  color: #8d4939;
  font-size: 12px;
}

.report-assistant-answer {
  overflow: hidden;
  border: 1px solid #dce8e3;
  border-radius: 14px;
  background: #fff;
}

.report-assistant-conclusion {
  padding: 14px;
  background: #174f46;
  color: #fff;
}

.report-assistant-conclusion small {
  color: rgba(255, 255, 255, 0.68);
}

.report-assistant-conclusion p {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.report-assistant-evidence {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.report-assistant-evidence > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #f3f7f5;
}

.report-assistant-evidence small,
.report-assistant-evidence b,
.report-assistant-evidence span {
  display: block;
}

.report-assistant-evidence small,
.report-assistant-evidence span {
  color: var(--muted);
  font-size: 10px;
}

.report-assistant-evidence b {
  margin: 4px 0;
  color: var(--accent);
  font-size: 15px;
}

.report-assistant-answer-block {
  padding: 0 14px 10px;
}

.report-assistant-answer-block h4 {
  margin: 3px 0 5px;
  font-size: 13px;
}

.report-assistant-answer-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.report-assistant-answer footer {
  padding: 10px 14px 13px;
  border-top: 1px solid #edf1ef;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.report-assistant-history-sheet {
  max-height: min(82vh, 720px);
}

.report-assistant-history-sheet > header,
.report-assistant-history-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.report-assistant-history-sheet > header h2,
.report-assistant-history-sheet > header p {
  margin: 0;
}

.report-assistant-history-sheet > header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.report-assistant-history-sheet > header > button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.report-assistant-history-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
}

.report-assistant-history-list {
  overflow-y: auto;
  max-height: 58vh;
}

.report-assistant-history-conversation {
  padding: 12px;
  border: 1px solid #dfe9e5;
  border-radius: 12px;
  background: #fff;
}

.report-assistant-history-conversation + .report-assistant-history-conversation {
  margin-top: 9px;
}

.report-assistant-history-title > button:first-child {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.report-history-delete,
.report-assistant-history-message button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #a34f3d;
  font-size: 11px;
}

.report-assistant-history-conversation > small {
  display: block;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.report-assistant-history-message {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid #edf1ef;
}

.report-assistant-history-message > span {
  padding: 2px 5px;
  border-radius: 6px;
  background: #e7f0ec;
  color: var(--brand);
  font-size: 10px;
}

.report-assistant-history-message p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .report-dashboard-chips,
  .report-reconciliation-chips {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .report-reconciliation-filters {
    grid-template-columns: 1fr;
  }

  .report-assistant-prompts {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .report-assistant-prompts button {
    flex: 1 1 calc(50% - 7px);
  }

  .processing-report-periods,
  .processing-report-picker {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .processing-report-picker,
  .processing-report-custom {
    grid-template-columns: 1fr 1fr;
  }

  .processing-report-picker label,
  .processing-report-custom label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .report-source-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .report-dashboard-hero strong {
    font-size: 29px;
  }

  .report-dashboard-summary-grid > div,
  .report-dashboard-business-grid > div {
    padding: 12px;
  }

  .report-dashboard-summary-grid b,
  .report-dashboard-business-grid b {
    font-size: 18px;
  }

  .report-dashboard-rank-head,
  .report-dashboard-rank-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 24px;
    gap: 5px;
  }

  .report-reconciliation-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metric-grid.three {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid.two-col,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .mini-row,
  .checkbox-row {
    grid-template-columns: 1fr;
  }
}

/* Direct-sale POS layout: keeps the next sales action within one phone screen. */
.sales-meta-compact {
  gap: 6px;
  padding: 10px 12px;
}

.sales-meta-main,
.sales-meta-sub {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sales-meta-main {
  color: #33413d;
  font-size: 14px;
  font-weight: 800;
}

.sales-meta-order {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.sales-meta-order small,
.sales-meta-sub {
  color: #7d8a92;
  font-size: 12px;
}

.sales-meta-order b {
  color: var(--ink);
  font-size: 15px;
}

.sales-scan-tip {
  color: #2f95e8;
  font-weight: 800;
  white-space: nowrap;
}

.compact-pair-card {
  padding: 11px 10px 10px;
  border: 1px solid #bfe3fb;
  background: #f5fbff;
}

.pair-head {
  grid-template-columns: 1fr auto;
  padding-left: 24px;
}

.compact-slot-list {
  gap: 6px;
  margin-top: 9px;
}

.compact-slot-row {
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid #e0edf5;
  background: #fff;
}

.compact-slot-row.empty {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  padding: 8px 9px;
  background: #fff;
}

.compact-slot-row.scan-success {
  animation: scan-success-pulse 0.9s ease-out;
}

@keyframes scan-success-pulse {
  0%, 45% {
    background: #e8f7ef;
    box-shadow: inset 3px 0 #148765;
  }
  100% {
    background: transparent;
    box-shadow: inset 3px 0 transparent;
  }
}

.slot-empty-label {
  color: #2f95e8;
  font-size: 13px;
  font-weight: 900;
}

.slot-select-button {
  display: flex;
  gap: 5px;
  justify-content: flex-start;
  align-items: center;
  min-height: 34px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.slot-select-button strong {
  font-size: 15px;
}

.slot-select-button small {
  font-size: 11px;
}

.slot-product-summary {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.slot-product-summary strong {
  font-size: 15px;
}

.slot-price-edit input {
  width: 76px;
  min-height: 30px;
  font-size: 16px;
}

.pair-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #dcebf4;
  font-size: 15px;
  font-weight: 900;
}

.pair-total b {
  color: #d3212b;
  font-size: 18px;
}

.add-after-pair-btn {
  margin-top: 9px;
  border: 1px solid #2f95e8;
  background: #2f95e8;
  color: #fff;
}

.add-after-pair-btn:active {
  background: #197cc7;
}

.cashier-panel {
  gap: 10px;
}

.cashier-amounts {
  display: grid;
  border: 1px solid #dbe6ed;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.cashier-amounts > div,
.cashier-amounts > label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 43px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f4;
  color: #3b4844;
  font-size: 15px;
}

.cashier-amounts > *:last-child {
  border-bottom: 0;
}

.cashier-amounts b,
.cashier-amounts em {
  color: #d3212b;
  font-size: 17px;
  font-style: normal;
  font-weight: 900;
}

.cashier-amounts em {
  display: inline-flex;
  align-items: center;
}

.cashier-amounts input {
  width: 94px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: #d3212b;
  text-align: right;
  font-size: 17px;
  font-weight: 900;
}

.cashier-amounts .receivable-row {
  background: #f3fbff;
  font-weight: 900;
}

.cashier-sheet {
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.void-cashier-sheet {
  display: grid;
  gap: 14px;
}

.void-cashier-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.void-cashier-sheet header button {
  min-width: 44px;
  min-height: 44px;
}

.void-cashier-sheet h2,
.void-cashier-sheet p {
  margin: 0;
}

.void-cashier-sheet p {
  color: var(--muted);
  line-height: 1.5;
}

.void-cashier-sheet textarea {
  min-height: 96px;
  resize: vertical;
}

.void-cashier-sheet .danger-btn {
  width: 100%;
  min-height: 52px;
}

.cashier-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cashier-sheet header h2 {
  margin: 0;
  font-size: 18px;
}

.cashier-sheet header button,
.cashier-payment-line > button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 22px;
}

.cashier-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.cashier-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel);
}

.cashier-summary span,
.cashier-verification,
.cashier-validation span {
  color: var(--muted);
  font-size: 12px;
}

.cashier-summary b {
  color: var(--ink);
  font-size: 15px;
}

.cashier-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.cashier-mode-switch button,
.cashier-method-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
}

.cashier-mode-switch button.active,
.cashier-method-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.cashier-payment-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.cashier-payment-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cashier-payment-line > div,
.cashier-payment-line label {
  min-width: 0;
}

.cashier-payment-line strong,
.cashier-verification {
  display: block;
}

.cashier-verification {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 5px;
}

.cashier-payment-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
}

.cashier-payment-line input[data-cashier-amount] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 17px;
  text-align: right;
}

.cashier-validation {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  margin: 14px -16px -18px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.cashier-validation > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cashier-validation.is-invalid b {
  color: var(--danger);
}

.cashier-validation.is-valid b {
  color: var(--brand);
}

.cashier-validation .primary-btn {
  width: 100%;
  min-height: 52px;
}

.receipt-remark-field {
  gap: 5px;
  margin-top: 0;
}

.receipt-remark-field textarea {
  min-height: 42px;
  padding: 10px;
  line-height: 1.45;
  transition: min-height 160ms ease;
}

.receipt-remark-field textarea:focus {
  min-height: 88px;
}

.service-order-evidence {
  display: grid;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f4;
}

.recipient-phone-last4-field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #34413d;
  font-size: 14px;
  font-weight: 800;
}

.recipient-phone-last4-field input {
  width: 7em;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.remark-image-field {
  display: grid;
  gap: 8px;
}

.remark-image-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #34413d;
  font-size: 14px;
  font-weight: 800;
}

.remark-image-heading small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.remark-image-grid {
  display: grid;
  gap: 8px;
  align-items: start;
}

.remark-image-grid.is-count-1 {
  grid-template-columns: 148px;
}

.remark-image-grid.is-count-2 {
  grid-template-columns: repeat(2, minmax(0, 112px));
}

.remark-image-item {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.remark-image-thumb {
  width: 100%;
  height: 104px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.remark-image-grid.is-count-2 .remark-image-thumb {
  height: 88px;
}

.remark-image-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.remark-image-delete {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  justify-self: end;
  border: 1px solid #efd4d8;
  border-radius: 6px;
  background: #fff;
  color: var(--danger);
}

.remark-image-delete .lucide-icon {
  width: 16px;
  height: 16px;
}

.add-order-image-btn {
  width: 148px;
  min-height: 40px;
  border: 1px dashed #91b8d3;
  border-radius: 6px;
  background: #f6fbff;
  color: #207dbd;
  font-weight: 800;
}

.remark-image-unavailable {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 8px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.order-evidence-card {
  display: grid;
  gap: 12px;
}

.order-evidence-card > p {
  margin: 0;
  color: #3c4a45;
}

.order-image-viewer {
  display: grid;
  gap: 12px;
}

.order-image-viewer-frame {
  display: grid;
  width: 100%;
  min-height: 260px;
  max-height: 70vh;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.order-image-viewer-frame img {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.order-remark-card p {
  margin: 0;
  color: #3c4a45;
  line-height: 1.6;
  white-space: pre-wrap;
}

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

.workbench-metric-grid > div,
.workbench-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workbench-metric-grid > div {
  min-height: 76px;
  padding: 12px;
}

.workbench-metric-grid small,
.workbench-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workbench-metric-grid b {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 18px;
}

.workbench-list {
  overflow: hidden;
}

.workbench-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf0ee;
}

.workbench-row:last-child {
  border-bottom: 0;
}

.workbench-row > div {
  min-width: 0;
  flex: 1;
}

.workbench-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-row.order > b {
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}

.workbench-row-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.sales-scan-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 11px;
  padding: 8px 10px;
  border: 1px solid #cfe0d9;
  border-radius: 8px;
  background: #f7fbf9;
}

.sales-scan-input > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sales-scan-input .lucide-icon {
  width: 16px;
  height: 16px;
}

.sales-scan-input input {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #d6e5de;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.managed-order-search {
  margin-bottom: 12px;
}

.managed-order-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #dfe7ec;
  border-radius: 12px;
  background: #fff;
}

.managed-order-list,
.order-product-list,
.order-return-list,
.order-operation-list {
  display: grid;
  gap: 10px;
}

.managed-order-card,
.order-management-summary,
.order-product-row,
.order-return-record,
.order-operation-item {
  border: 1px solid #dfe7ec;
  border-radius: 12px;
  background: #fff;
}

.managed-order-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.managed-order-summary,
.managed-order-payment,
.order-management-heading,
.order-product-title,
.order-return-record > div,
.order-operation-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.managed-order-summary {
  border: 0;
}

.managed-order-summary h3,
.order-product-title h3,
.order-management-heading h2 {
  margin: 0;
}

.managed-order-summary small,
.managed-order-payment small,
.order-product-row small,
.order-return-record small,
.order-operation-item small {
  color: var(--muted);
  line-height: 1.5;
}

.managed-order-payment > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.managed-order-payment > div:last-child {
  text-align: right;
}

.managed-order-products,
.order-product-row p,
.order-return-record p,
.order-operation-item p {
  margin: 0;
  color: var(--muted);
}

.managed-order-open {
  width: 100%;
  min-height: 44px;
}

.order-management-section {
  display: grid;
  gap: 12px;
}

.order-management-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.order-management-summary > div {
  display: grid;
  gap: 4px;
}

.order-management-summary small,
.order-cashier-facts span {
  color: var(--muted);
}

.order-cashier-facts {
  display: grid;
  gap: 8px;
}

.order-cashier-facts p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.order-management-remark,
.order-history-warning {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f6f8fa;
  color: var(--muted);
}

.order-history-warning {
  background: #fff7ed;
  color: #9a5b12;
}

.order-product-row,
.order-return-record,
.order-operation-item {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.order-product-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-product-actions button {
  min-height: 44px;
}

.order-price-correction-sheet,
.order-product-replacement-sheet,
.order-return-sheet {
  display: grid;
  gap: 14px;
  max-height: min(88dvh, 760px);
  overflow: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.order-price-correction-sheet header,
.order-product-replacement-sheet header,
.order-return-sheet header,
.order-price-correction-sheet footer,
.order-product-replacement-sheet footer,
.order-return-sheet footer,
.order-return-sheet-toolbar,
.order-sheet-summary,
.order-return-stock,
.order-product-compare {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.order-price-correction-sheet header h2,
.order-product-replacement-sheet header h2,
.order-return-sheet header h2,
.order-return-sheet-toolbar p,
.order-product-replacement-sheet p {
  margin: 0;
}

.order-price-correction-sheet header > button,
.order-product-replacement-sheet header > button,
.order-return-sheet header > button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 24px;
}

.order-sheet-summary {
  padding: 12px;
  border-radius: 10px;
  background: #f6f8fa;
}

.order-correction-payments,
.order-return-lines,
.order-return-total {
  display: grid;
  gap: 10px;
}

.order-return-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f2;
}

.order-return-line > span,
.order-return-stock > span {
  display: grid;
  gap: 2px;
}

.order-return-line input[type="checkbox"],
.order-return-stock input {
  width: 22px;
  height: 22px;
}

.order-return-line input[type="number"] {
  width: 100%;
  min-height: 44px;
}

.order-return-total {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: #fff;
}

.order-return-stock {
  justify-content: flex-start;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid #dfe7ec;
  border-radius: 10px;
}

.order-product-compare > div {
  display: grid;
  flex: 1;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: #f6f8fa;
}

.order-price-correction-sheet footer > *,
.order-product-replacement-sheet footer > *,
.order-return-sheet footer > * {
  flex: 1;
}

.order-price-correction-sheet button,
.order-product-replacement-sheet button,
.order-return-sheet button,
.order-return-sheet input,
.order-price-correction-sheet input,
.order-product-replacement-sheet input {
  min-height: 44px;
}

.processing-stats-page {
  display: grid;
  gap: 12px;
  margin: -14px;
  padding: 14px 14px 0;
}

.processing-stats-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.processing-stats-date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(146px, auto);
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.processing-stats-date input,
.processing-stats-page input,
.processing-stats-page button,
.processing-stats-retry {
  min-height: 44px;
}

.processing-stats-date input {
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

.processing-stats-summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 9px;
  background: #edf5f1;
  color: var(--brand);
}

.processing-stats-summary span,
.processing-stats-meta {
  color: var(--muted);
  font-size: 12px;
}

.processing-stats-table {
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.processing-stats-head,
.processing-stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(72px, 96px));
  gap: 8px;
  align-items: center;
}

.processing-stats-head {
  min-height: 40px;
  padding: 0 10px;
  background: #f4f6f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.processing-stats-head span:first-child {
  text-align: left;
}

.processing-stats-row {
  min-height: 60px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.processing-stats-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.processing-stats-row label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.processing-stats-row input {
  width: 100%;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid #d7dfdb;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.processing-stats-row input:focus {
  border-color: var(--brand-2);
  outline: 3px solid rgba(44, 112, 103, 0.14);
}

.processing-stats-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1ef;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.processing-stats-conflict {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a5b12;
}

.processing-stats-conflict p {
  margin: 0;
  overflow-wrap: anywhere;
}

.processing-stats-meta {
  margin: 0;
  text-align: right;
}

.processing-stats-empty {
  display: grid;
  min-height: 140px;
  padding: 20px;
  place-items: center;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.processing-stats-retry {
  border: 1px solid var(--brand);
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}

.processing-stats-save-bar {
  position: sticky;
  z-index: 5;
  bottom: 0;
  margin: 0 -14px;
  padding: 12px 14px 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(246, 244, 239, 0.96);
  backdrop-filter: blur(10px);
}

.processing-stats-save-bar button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.processing-stats-save-bar button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.processing-stats-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.processing-stats-worker-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.processing-stats-worker-tabs button,
.processing-stats-worker-actions button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.processing-stats-worker-tabs button.active {
  border-color: var(--brand);
  background: #edf5f1;
  color: var(--brand);
}

.processing-stats-worker-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.processing-stats-worker-create label,
.processing-stats-worker-edit {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.processing-stats-worker-create input,
.processing-stats-worker-edit input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.processing-stats-worker-create > button {
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.processing-stats-worker-list {
  display: grid;
  gap: 10px;
}

.processing-stats-worker-row {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.processing-stats-worker-row > div:first-child,
.processing-stats-worker-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.processing-stats-worker-row > div:first-child {
  display: grid;
  gap: 4px;
}

.processing-stats-worker-row small {
  color: var(--muted);
}

.processing-stats-worker-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.processing-stats-worker-actions button.danger {
  border-color: #e8c8c4;
  color: var(--danger);
}

.processing-stats-workers-page button:disabled {
  cursor: wait;
  opacity: 0.55;
}

@media (max-width: 420px) {
  .processing-stats-worker-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tile-badge {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  margin-left: 4px;
  padding: 2px 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
}

.child-warranty-page,
.child-warranty-form,
.child-warranty-detail {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.child-warranty-page *,
.child-warranty-form *,
.child-warranty-detail * {
  min-width: 0;
}

.child-warranty-form,
.child-warranty-detail {
  display: grid;
  gap: 12px;
}

.child-warranty-form > .form-card,
.child-warranty-detail > .form-card,
.child-warranty-detail .form-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  overflow-wrap: anywhere;
}

.child-warranty-form input,
.child-warranty-form textarea,
.child-warranty-detail input,
.child-warranty-detail textarea {
  width: 100%;
  max-width: 100%;
}

.child-warranty-page button,
.child-warranty-form button,
.child-warranty-detail button,
.child-warranty-push-notice button {
  min-height: 44px;
}

.child-warranty-record {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.child-warranty-detail p,
.child-warranty-detail strong,
.child-warranty-detail textarea {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.child-warranty-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 62vh;
  border-radius: 8px;
  object-fit: contain;
}

.child-warranty-actions {
  display: grid;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.child-warranty-actions:empty {
  display: none;
}

.child-warranty-push-notice {
  position: fixed;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(calc(100% - 24px), 406px);
  min-width: 0;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid #e7c782;
  border-radius: 10px;
  background: #fff8e7;
  color: #6d4a0f;
  box-shadow: var(--shadow);
}

.child-warranty-push-notice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.child-warranty-push-notice button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 390px) {
  .child-warranty-page,
  .child-warranty-form,
  .child-warranty-detail {
    overflow-x: clip;
  }

  .child-warranty-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .child-warranty-summary > div {
    padding: 10px 6px;
  }

  .child-warranty-push-notice {
    align-items: stretch;
    flex-direction: column;
  }
}
