:root {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",system-ui,"PingFang SC",sans-serif;
  color: #1d1d1f;
  background: #eceef2;
  --blue: #0071e3;
  --blue-dark: #0059b2;
  --blue-soft: rgb(0 113 227 / 8%);
  --gold: #b79b62;
  --text: #1d1d1f;
  --muted: #686872;
  --quiet: #8a8a93;
  --line: rgb(60 60 67 / 10%);
  --row-line: rgb(60 60 67 / 7%);
  --surface: #fff;
  --panel: #f9fafb;
  --bad: #a53b37;
  --bad-soft: #fcedec;
  --warn: #9a681b;
  --warn-soft: #fff5de;
  --good: #307251;
  --good-soft: #eaf5ee;
  --cancel-soft: #edf0f3;
  font-size: 13px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: #eceef2;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.app-shell {
  display: flex;
  gap: 0;
  min-height: 100vh;
  padding: 12px;
}
.sidebar {
  position: sticky;
  top: 12px;
  width: 236px;
  height: calc(100vh - 24px);
  flex: 0 0 236px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 13px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 14px 0 0 14px;
  background: #f5f5f7;
  box-shadow: none;
  z-index: 5;
}
@supports ((backdrop-filter: blur(1px))) {
  .sidebar {
    background: rgb(245 245 247 / 78%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
  }
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 2px 8px 13px;
  border-bottom: 1px solid var(--line);
}
.brand-lockup img {
  width: 54px;
  height: 42px;
  object-fit: contain;
}
.brand-lockup strong {
  display: block;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -.015em;
  white-space: nowrap;
}
.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 11px;
  white-space: nowrap;
}
.demo-chip {
  margin: 12px 8px 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}
.nav-group {
  padding: 12px 11px 5px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 650;
}
.nav-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  transition: background .15s,color .15s;
}
.nav-item:hover {
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.nav-item.active {
  color: #fff;
  background: var(--blue);
}
.nav-item.active .nav-icon {
  color: #fff;
  background: #ffffff2b;
}
.nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  border-radius: 5px;
  color: var(--blue);
  background: #e8eef3;
  font-size: 11px;
}
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--muted);
  background: #edf0f3;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count {
  color: #fff;
  background: #ffffff36;
}
.side-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 10px 0;
  color: var(--muted);
  font-size: 11px;
}
.link-button {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  text-align: left;
}
.workspace {
  flex: 1;
  min-width: 0;
  border-radius: 0 14px 14px 0;
  background: #f7f8fa;
  box-shadow: 0 1px 5px rgb(0 0 0 / 3%);
}
.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 76%);
  backdrop-filter: blur(18px) saturate(150%);
}
.topbar-title {
  min-width: 0;
  flex: 1;
}
.kicker {
  margin: 0 0 3px;
  color: var(--quiet);
  font-size: 10px;
  letter-spacing: .4px;
}
.topbar h1,
#view-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.022em;
}
.view-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-mode-label {
  color: var(--muted);
  font-size: 11px;
}
.button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 13px;
  color: var(--text);
  box-shadow: 0 1px 2px #10182808;
}
.button:hover {
  border-color: #bec8d3;
  background: #f9fafb;
}
.button.small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}
.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.button.primary:hover {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}
.button.danger {
  border-color: #d9a29f;
  color: var(--bad);
  background: #fff;
}
.button.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--blue);
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}
.icon-button:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.menu-btn,
.sidebar-close {
  display: none;
}
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 11px;
  white-space: nowrap;
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge.cancel,
.badge.muted {
  background: var(--cancel-soft);
  color: var(--muted);
}
.badge.stage-ready {
  background: #e9e9fb;
  color: #464b91;
}
.badge.stage-shipped {
  background: var(--good-soft);
  color: var(--good);
}
.badge.stage-ordered,
.badge.stage-cancelled {
  background: var(--cancel-soft);
  color: var(--muted);
}
.badge.stage-procurement {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.badge.stage-inspection,
.badge.stage-awaiting_customer {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.stage-qc_failed,
.badge.stage-customer_rejected {
  background: var(--bad-soft);
  color: var(--bad);
}
.banner {
  margin: 3px 14px 0;
  padding: 11px 13px;
  border: 1px solid #cbdde9;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 12px;
}
.banner.error,
.modal-error {
  border-color: #edc5c2;
  background: var(--bad-soft);
  color: var(--bad);
}
.view-root {
  padding: 22px 24px 56px;
}
.hero,
.dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.hero h2,
.view-head h2 {
  margin: 0 0 5px;
  font-size: 20px;
  font-weight: 600;
}
.hero p,
.view-head p {
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.genie {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.metric-card,
.panel,
.list-panel,
.dashboard-finance,
.stage-strip {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px #10182808;
}
.metric-card {
  position: relative;
  min-height: 100px;
  padding: 15px;
  text-align: left;
}
.metric-card strong {
  display: block;
  color: var(--blue-dark);
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.metric-card span {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
}
.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--quiet);
  font-size: 11px;
}
.metric-card:after {
  content: "→";
  position: absolute;
  right: 15px;
  bottom: 13px;
  color: var(--gold);
  font-size: 17px;
}
.stage-strip {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  overflow: hidden;
  margin-bottom: 18px;
}
.stage-entry {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  border: 0;
  border-right: 1px solid var(--row-line);
  background: #fff;
  padding: 13px 12px;
  color: var(--text);
  text-align: left;
}
.stage-entry:last-child {
  border-right: 0;
}
.stage-entry:hover {
  background: var(--blue-soft);
}
.stage-entry .stage-label {
  color: var(--muted);
  font-size: 11px;
}
.stage-entry strong {
  color: var(--text);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stage-entry .stage-arrow {
  position: absolute;
  right: 11px;
  bottom: 11px;
  color: var(--gold);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(280px,1fr);
  gap: 16px;
  align-items: start;
}
.dashboard-orders,
.dashboard-finance {
  min-width: 0;
}
.section-head,
.view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
}
.section-head h2,
.section-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.section-count {
  color: var(--quiet);
  font-size: 11px;
}
.finance-section {
  padding: 13px 15px;
  border-bottom: 1px solid var(--row-line);
}
.finance-section:last-child {
  border-bottom: 0;
}
.finance-section h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
}
.finance-rows,
.detail-kv {
  display: grid;
  gap: 7px;
  margin: 0;
}
.finance-rows div,
.detail-kv div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.finance-rows dt,
.detail-kv dt {
  color: var(--muted);
}
.finance-rows dd,
.detail-kv dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.finance-rows .emphasis dd {
  color: var(--warn);
  font-weight: 650;
}
.finance-rows .refund dd {
  color: var(--bad);
}
.dashboard-events {
  margin-top: 16px;
}
.mini-event {
  display: flex;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--row-line);
  font-size: 11px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}
.toolbar input,
.toolbar select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.login-card input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: var(--text);
}
.toolbar input {
  flex: 1 1 220px;
}
.toolbar select {
  flex: 0 0 150px;
}
.toolbar input:focus,
.toolbar select:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--blue-dark);
  background: var(--blue-soft);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}
.table th {
  height: 36px;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--quiet);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}
.table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--row-line);
  color: var(--text);
  font-size: 12px;
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .cell-primary {
  display: block;
  color: var(--blue-dark);
  font-weight: 650;
}
.table .cell-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.table .cell-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .cell-actions {
  text-align: right;
  white-space: nowrap;
}
.table td .badge {
  margin: 2px 3px 2px 0;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}
.empty {
  padding: 40px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}
.unit-list,
.customer-grid,
.catalog-grid,
.settings-grid,
.detail-units {
  display: grid;
  gap: 10px;
}
.unit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px #10182808;
}
.unit-row > div:first-child,
.unit-row .unit-identity {
  flex: 1;
  min-width: 0;
}
.unit-row strong {
  display: block;
  font-size: 14px;
}
.unit-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.unit-order {
  color: var(--muted);
  font-size: 11px;
}
.customer-grid,
.catalog-grid,
.settings-grid {
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
}
.panel {
  display: block;
  padding: 16px;
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.panel p {
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.event-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.event {
  display: flex;
  gap: 15px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--row-line);
  font-size: 12px;
}
.event:last-child {
  border-bottom: 0;
}
.modal {
  width: min(620px,calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  border: 0;
  padding: 0;
  background: transparent;
}
.modal::backdrop {
  background: rgb(0 0 0 / 24%);
  backdrop-filter: blur(5px);
}
.modal-card {
  max-height: calc(100dvh - 30px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f5f7;
  box-shadow: 0 18px 44px #10182826;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.modal h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.modal-head .muted {
  margin-top: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label,
.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.form-grid textarea {
  min-height: 78px;
  resize: vertical;
}
.modal-actions,
.detail-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.money-line {
  margin: 14px 0;
  font-size: 12px;
}
.modal-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.blocked-reasons,
.success-line {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.blocked-reasons {
  background: var(--bad-soft);
  color: var(--bad);
}
.success-line {
  background: var(--good-soft);
  color: var(--good);
}
.ledger-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.ledger-list p,
.shipment-list p {
  margin: 0;
  overflow-wrap: anywhere;
}
.shipment-list {
  display: grid;
  gap: 5px;
  padding-top: 5px;
}
.login-view {
  width: 100%;
  min-height: calc(100vh - 24px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(410px,calc(100vw - 30px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 30px #10182814;
}
.login-logo {
  width: 110px;
  height: 66px;
  object-fit: contain;
}
.login-card h1 {
  margin: 16px 0 7px;
  font-size: 24px;
  font-weight: 600;
}
.login-card form {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}
.login-card form .button {
  width: 100%;
  margin-top: 4px;
}
.error-text {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--bad);
  font-size: 12px;
}
.mono {
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-variant-numeric: tabular-nums;
}
.qc-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.qc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill,64px);
  gap: 7px;
  margin-top: 9px;
}
.finance-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
.workspace[hidden],
.sidebar[hidden],
.login-view[hidden],
.nav-backdrop[hidden] {
  display: none!important;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.detail-modal {
  width: min(1040px,calc(100vw - 48px));
  max-width: min(1040px,calc(100vw - 48px));
}
.detail-modal .modal-card {
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.detail-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.detail-body {
  max-height: calc(100dvh - 184px);
  overflow: auto;
  padding: 20px 22px;
}
.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 20px;
  align-items: start;
}
.order-detail-main,
.order-detail-aside {
  min-width: 0;
}
.detail-section {
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.detail-section h3 {
  margin: 0 0 11px;
  font-size: 14px;
}
.detail-unit {
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.detail-unit:last-child {
  margin-bottom: 0;
}
.detail-unit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.detail-unit-head strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.detail-unit-identifiers {
  display: grid;
  gap: 4px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.detail-kv {
  grid-template-columns: repeat(2,minmax(0,1fr));
}
.detail-kv dd {
  color: var(--text);
}
.qc-section,
.customer-decision {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--row-line);
}
.qc-section h4,
.customer-decision h4 {
  margin: 0 0 8px;
  font-size: 12px;
}
.qc-round {
  padding: 8px 0;
  border-top: 1px solid var(--row-line);
}
.qc-round:first-of-type {
  border-top: 0;
}
.qc-round summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.detail-actions {
  justify-content: space-between;
  margin: 0;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
}
.detail-actions-main,
.detail-actions-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-actions-danger {
  margin-left: auto;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3;
  border: 0;
  background: #141c2252;
}
@media (max-width:1250px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width:900px) {
  .detail-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
  .order-detail-layout {
    grid-template-columns: 1fr;
  }
  .order-detail-aside {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
  }
  .order-detail-aside .detail-section {
    margin: 0;
  }
}
@media (max-width:760px) {
  .app-shell {
    display: block;
    padding: 0;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px,88vw);
    height: 100dvh;
    max-height: none;
    border-radius: 0 12px 12px 0;
    transform: translateX(-105%);
    transition: transform .18s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: inline-grid;
    position: absolute;
    top: 11px;
    right: 10px;
  }
  .menu-btn {
    display: inline-grid;
  }
  .topbar {
    min-height: 72px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 12px 16px;
    border-radius: 0;
  }
  .topbar-title {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .topbar h1,
  #view-title {
    font-size: 22px;
    white-space: nowrap;
    overflow: visible;
  }
  .topbar .kicker {
    display: none;
  }
  .top-mode-label {
    display: inline-block;
    min-width: 48px;
    white-space: nowrap;
  }
  .top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
    gap: 3px;
    min-width: 0;
  }
  .top-actions .status-pill {
    display: none;
  }
  .top-actions .button {
    min-height: 44px;
    padding: 7px 9px;
  }
  #settings-btn {
    display: none;
  }
  .view-root {
    padding: 14px 16px calc(45px + env(safe-area-inset-bottom));
  }
  .metric-grid,
  .stage-strip {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .stage-entry {
    min-height: 88px;
    border-bottom: 1px solid var(--row-line);
  }
  .stage-entry:nth-child(2n) {
    border-right: 0;
  }
  .stage-entry:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .hero,
  .dashboard-intro {
    margin-bottom: 14px;
  }
  .hero h2 {
    font-size: 19px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .customer-grid,
  .catalog-grid,
  .settings-grid,
  .finance-grid {
    grid-template-columns: 1fr;
  }
  .toolbar input,
  .toolbar select {
    flex: 1 1 100%;
    min-height: 44px;
    font-size: 16px;
  }
  .button {
    min-height: 44px;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .table {
    min-width: 0;
    display: block;
  }
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }
  .table tr {
    margin-bottom: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px #10182808;
  }
  .table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 37px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--row-line);
    text-align: right;
  }
  .table td:before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--quiet);
    text-align: left;
    font-size: 11px;
  }
  .table td:first-child {
    display: block;
    text-align: left;
  }
  .table td:first-child:before {
    display: none;
  }
  .table td.cell-actions {
    justify-content: flex-end;
  }
  .table td.cell-actions:before {
    display: none;
  }
  .detail-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin: 8px;
  }
  .detail-modal .modal-card {
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }
  .detail-modal .modal-head {
    min-height: 64px;
    padding: 14px 16px;
  }
  .detail-body {
    max-height: calc(100dvh - 144px);
    padding: 14px 8px;
  }
  .order-detail-layout {
    gap: 10px;
  }
  .order-detail-aside {
    display: block;
  }
  .order-detail-aside .detail-section {
    margin-bottom: 10px;
  }
  .detail-section {
    padding: 12px;
  }
  .detail-kv {
    grid-template-columns: 1fr;
  }
  .detail-actions {
    display: block;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .detail-actions-main,
  .detail-actions-danger {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0 0 8px;
  }
  .detail-actions .button {
    width: 100%;
  }
  .login-view {
    min-height: 100dvh;
    padding: 16px;
  }
  .login-card {
    width: 100%;
    padding: 24px;
  }
  .login-card input {
    min-height: 44px;
    font-size: 16px;
  }
}
@media (prefers-reduced-motion:reduce) {
  *,
  *::before,
  *::after {
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item.active .nav-icon svg {
  stroke: #fff;
}
.stage-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr 28px;
  min-height: 100px;
  padding: 16px;
}
.stage-entry svg {
  grid-column: 2;
  grid-row: 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stage-entry-label {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  color: var(--muted);
  font-size: 11px;
}
.stage-entry strong {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}
.stage-entry-arrow {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  color: var(--gold);
}
.stage-entry .stage-label,
.stage-entry .stage-arrow {
  display: none;
}
.dashboard-intro h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.dashboard-intro p {
  margin: 4px 0 0;
}
.dashboard-intro {
  max-height: 52px;
}
.dashboard-finance {
  padding: 16px;
}
.dashboard-finance .finance-section {
  padding: 12px 0;
}
.dashboard-finance .section-head {
  margin-bottom: 10px;
}
.dashboard-events {
  margin-top: 12px;
}
.mini-event {
  display: grid;
  grid-template-columns: 86px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  line-height: 1.45;
}
.mini-event time {
  color: var(--quiet);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.mini-event span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.table td.cell-money,
.table td.mono {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.settings-btn,
#settings-btn {
  display: none;
}
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.order-detail-aside .detail-kv {
  grid-template-columns: 1fr;
}
.ledger-entry {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--row-line);
  font-size: 11px;
}
.ledger-entry strong,
.ledger-entry > span:first-of-type {
  font-size: 12px;
}
.ledger-entry strong {
  grid-column: 1;
}
.ledger-entry > span:first-of-type {
  grid-column: 2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger-entry .mono {
  grid-column: 1;
  overflow-wrap: anywhere;
}
.ledger-entry time {
  grid-column: 2;
  color: var(--quiet);
  text-align: right;
  overflow-wrap: anywhere;
}
.order-detail-main > .detail-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.order-detail-main > .detail-section > .section-head {
  margin-bottom: 12px;
}
.detail-unit {
  padding: 16px;
}
.detail-unit > .detail-section {
  padding: 12px 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--row-line);
  border-radius: 0;
  background: transparent;
}
.detail-unit > .detail-section h4 {
  margin: 0 0 8px;
}
.purchase-section .detail-kv {
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.customer-decision .detail-kv {
  grid-template-columns: 76px minmax(0,1fr);
}
.customer-decision .detail-kv div {
  justify-content: flex-start;
}
.customer-decision .detail-kv dd {
  text-align: left;
  min-width: 0;
}
.detail-evidence,
.detail-note,
.detail-longtext {
  overflow-wrap: anywhere;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 11px;
}
.detail-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.detail-head p {
  margin: 4px 0 0;
}
.detail-head .icon-button {
  flex: 0 0 auto;
}
@media (max-width:760px) {
  .detail-actions {
    max-height: 36dvh;
    overflow: auto;
  }
  .detail-body {
    display: block;
    min-height: 0;
  }
  .detail-actions-main,
  .detail-actions-danger {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .purchase-section .detail-kv {
    grid-template-columns: 1fr;
  }
  .customer-decision .detail-kv {
    grid-template-columns: 64px minmax(0,1fr);
  }
}
.detail-card {
  height: min(calc(100dvh - 48px),900px);
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}
.detail-card .modal-head {
  flex: none;
}
.detail-card .detail-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.detail-card .detail-actions {
  flex: none;
  max-height: 36dvh;
  overflow: auto;
}
.customer-decision .detail-kv {
  grid-template-columns: 1fr;
}
.customer-decision .detail-line {
  display: grid;
  grid-template-columns: 76px minmax(0,1fr);
  justify-content: initial;
}
.customer-decision .detail-line dd {
  text-align: left;
}
.purchase-section .detail-line {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: initial;
}
.purchase-section .detail-line dd {
  text-align: left;
}
.ledger-entry .mono,
.ledger-entry time {
  grid-column: 1/-1;
  text-align: left;
}
.dashboard-exceptions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.exception-link {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #edc5c2;
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 12px;
}
.exception-link.is-zero {
  border-color: var(--line);
  background: var(--cancel-soft);
  color: var(--quiet);
}
@media (max-width:760px) {
  .detail-card {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .detail-card .modal-head {
    min-height: 64px;
  }
  .detail-card .detail-body {
    max-height: none;
    overflow: auto;
  }
  .menu-btn,
  .sidebar-close {
    width: 44px;
    height: 44px;
  }
  .icon-button {
    width: 44px;
    height: 44px;
  }
  .topbar .view-subtitle,
  .topbar-title .view-subtitle {
    display: none;
  }
  .customer-decision .detail-line {
    grid-template-columns: 64px minmax(0,1fr);
  }
  .exception-link {
    min-height: 44px;
    flex: 1 1 auto;
  }
}
.stage-count-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
@media (max-width:760px) {
  .sidebar {
    visibility: hidden;
  }
  .sidebar.open {
    visibility: visible;
  }
  .button.small {
    min-height: 44px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}
.detail-modal {
  height: calc(100dvh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.detail-modal .detail-card {
  height: 100%;
  max-height: 100%;
}
@media (max-width:760px) {
  .detail-modal {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .detail-modal .detail-card {
    height: 100%;
    max-height: 100%;
  }
}
.stage-entry strong + .stage-count-unit {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  margin-left: 30px;
}
/* Bilingual controls and long-label safeguards. */
.sr-only {
  position: absolute!important;
  width: 1px!important;
  height: 1px!important;
  padding: 0!important;
  margin: -1px!important;
  overflow: hidden!important;
  clip: rect(0,0,0,0)!important;
  white-space: nowrap!important;
  border: 0!important;
}
.locale-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  min-width: 94px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.login-card .locale-picker {
  width: max-content;
  margin-bottom: 14px;
}
.locale-picker select,
select.locale-picker {
  width: max-content;
  min-width: 94px;
  min-height: 36px;
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background-color: #fff;
  background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position: calc(100% - 13px) 15px,calc(100% - 9px) 15px;
  background-size: 4px 4px,4px 4px;
  background-repeat: no-repeat;
  font-size: 12px;
}
.locale-picker select:focus-visible,
select.locale-picker:focus-visible {
  outline: 3px solid rgb(0 113 227 / 25%);
  outline-offset: 1px;
  border-color: var(--blue);
}
.modal-head h2,
.detail-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.modal-head > .locale-picker,
.detail-head > select.locale-picker {
  flex: 0 0 auto;
}
.brand-lockup small {
  max-width: 140px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.nav-item > span:not(.nav-count) {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.nav-count {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width:760px) {
  .locale-picker select,
  select.locale-picker {
    min-height: 44px;
  }
  .modal-head > .locale-picker,
  .detail-head > select.locale-picker {
    min-width: 94px;
  }
  .modal-head > .icon-button,
  .detail-head > .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}
