:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-alt: #f0f2ee;
  --ink: #17201b;
  --muted: #667169;
  --line: #d9ded9;
  --line-strong: #bcc6be;
  --primary: #126b4b;
  --primary-dark: #0d5038;
  --blue: #2765a8;
  --blue-bg: #eaf2fb;
  --green: #176b49;
  --green-bg: #e8f4ee;
  --amber: #8a5a08;
  --amber-bg: #fff4d8;
  --red: #a43b35;
  --red-bg: #fcecea;
  --gray-bg: #edf0ed;
  --shadow: 0 12px 34px rgba(18, 35, 25, 0.09);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.loading-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 17px;
  font-weight: 800;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  width: min(1480px, calc(100% - 36px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-inner-wide {
  width: 100%;
  padding-inline: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
}

.brand-context {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-button {
  min-width: 48px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.language-button:hover {
  border-color: var(--ink);
  background: var(--surface-alt);
}

.error-language {
  margin-top: 18px;
}

.role-badge,
.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.role-badge {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid #c7dfd2;
}

.status-pending,
.status-waiting,
.status-unsettled {
  color: var(--amber);
  background: var(--amber-bg);
}

.status-processing {
  color: var(--blue);
  background: var(--blue-bg);
}

.status-completed,
.status-confirmed,
.status-settled {
  color: var(--green);
  background: var(--green-bg);
}

.status-failed,
.status-rejected {
  color: var(--red);
  background: var(--red-bg);
}

.page {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.workspace-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
}

.app-sidebar {
  position: sticky;
  top: 64px;
  min-height: calc(100vh - 64px);
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.app-sidebar-label {
  padding: 0 9px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.app-sidebar-nav {
  display: grid;
  gap: 4px;
}

.app-sidebar-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
}

.app-sidebar-link:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-alt);
}

.app-sidebar-link.active {
  color: var(--primary-dark);
  border-color: #9bc8b4;
  background: var(--green-bg);
}

.app-sidebar-link strong {
  min-width: 25px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 11px;
  text-align: center;
}

.app-sidebar-link.active strong {
  color: var(--primary-dark);
  background: var(--surface);
}

.app-sidebar-logout {
  min-height: 38px;
  margin-top: auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 650;
}

.app-sidebar-logout:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-alt);
}

.admin-shell .admin-page {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 24px 18px 64px;
}

.portal-shell .portal-page {
  min-width: 0;
}

.section-first {
  margin-top: 0;
}

.guide-heading {
  max-width: 780px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.guide-heading h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.guide-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.guide-layout {
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  padding-top: 28px;
}

.admin-guide-layout {
  max-width: 1360px;
  align-items: start;
}

.guide-section h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.guide-section-wide {
  grid-column: 1 / -1;
}

.guide-section-intro {
  max-width: 920px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.lark-guide-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
  gap: 40px;
  padding-top: 4px;
}

.lark-guide-grid > * {
  min-width: 0;
}

.guide-subheading {
  margin: 0 0 10px;
  font-size: 14px;
}

.guide-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.guide-event-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.guide-event-table th,
.guide-event-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.guide-event-table th {
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.guide-event-table th:first-child {
  width: 34%;
}

.guide-inline-note {
  margin: 12px 0 0;
  padding-left: 12px;
  border-left: 3px solid #9bc8b4;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-inline-note strong {
  color: var(--ink);
}

.guide-lark-ops {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.guide-note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin: 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.guide-step {
  min-height: 94px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.guide-step-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #9bc8b4;
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 800;
}

.guide-step h3 {
  margin: 1px 0 4px;
  font-size: 14px;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-page {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.login-mark {
  width: 42px;
  height: 42px;
}

.page-heading h1,
.section-heading h2,
.dialog h2 {
  margin: 0;
  font-weight: 760;
  letter-spacing: 0;
}

.page-heading h1 {
  font-size: 24px;
  line-height: 1.25;
}

.page-subtitle {
  margin-top: 5px;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.button,
.icon-button,
.compact-button {
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button {
  min-height: 38px;
  padding: 8px 14px;
  font-weight: 700;
}

.button.primary {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
}

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

.button.secondary,
.compact-button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button.secondary:hover,
.compact-button:hover {
  border-color: var(--ink);
  background: var(--surface-alt);
}

.button:disabled,
.compact-button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  font-size: 20px;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.compact-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.compact-button.emphasis {
  color: var(--primary);
  border-color: #9bc8b4;
  background: var(--green-bg);
}

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

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

.stats-grid.admin-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat {
  min-height: 102px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-value {
  margin-top: 8px;
  font-size: 25px;
  font-weight: 760;
  line-height: 1;
}

.stat-detail {
  min-height: 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.stat.green {
  border-top: 3px solid var(--green);
}

.stat.blue {
  border-top: 3px solid var(--blue);
}

.stat.amber {
  border-top: 3px solid #c4871a;
}

.stat.red {
  border-top: 3px solid var(--red);
}

.section {
  margin-top: 24px;
}

.section-heading {
  min-height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h2 {
  font-size: 16px;
}

.section-meta {
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(18, 35, 25, 0.02);
}

.entry-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1.8fr) minmax(180px, 1fr) auto;
  gap: 12px;
  padding: 16px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

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

.compact-filter {
  width: min(260px, 100%);
}

.order-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.customer-sidebar {
  position: sticky;
  top: 78px;
  min-width: 0;
  max-height: 680px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.sidebar-search {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.sidebar-search > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-search input {
  min-height: 34px;
}

.customer-sidebar nav {
  display: grid;
  gap: 4px;
  max-height: 590px;
  overflow-y: auto;
}

.customer-list-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.customer-list-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-item strong {
  min-width: 25px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 11px;
  text-align: center;
}

.customer-list-item:hover {
  border-color: var(--line);
  background: var(--surface-alt);
}

.customer-list-item.active {
  border-color: #9bc8b4;
  color: var(--primary-dark);
  background: var(--green-bg);
  font-weight: 700;
}

.customer-list-item.active strong {
  color: var(--primary-dark);
  background: var(--surface);
}

.order-workspace {
  min-width: 0;
}

.workspace-heading {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.workspace-heading h3 {
  margin: 0;
  font-size: 17px;
}

.order-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  gap: 10px 16px;
  margin-bottom: 10px;
}

.admin-page .advanced-filter-row {
  flex-wrap: wrap;
}

.filter-presets {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
}

.filter-preset {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-preset:hover,
.filter-preset.active {
  color: var(--primary-dark);
  border-color: #9bc8b4;
  background: var(--green-bg);
}

.order-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.order-search input {
  min-height: 34px;
}

.advanced-filter-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  overflow: visible;
}

.filter-menu {
  position: relative;
  flex: 0 0 auto;
}

.filter-menu > summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  white-space: nowrap;
}

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

.filter-menu > summary::after {
  content: "▾";
  margin-left: 7px;
  color: var(--muted);
}

.filter-menu[open] > summary {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 107, 75, 0.11);
}

.filter-popover {
  position: absolute;
  z-index: 15;
  top: calc(100% + 5px);
  left: 0;
  width: max-content;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-option {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-option:hover {
  background: var(--surface-alt);
}

.filter-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.filter-clear-field {
  width: 100%;
  margin-top: 5px;
  padding: 6px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.date-filter {
  flex: 0 0 145px;
  display: grid;
  gap: 3px;
}

.date-filter span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.date-filter input {
  min-height: 32px;
  padding-block: 4px;
  font-size: 12px;
}

.pagination-bar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pagination-controls,
.pagination-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-controls select {
  width: 72px;
  min-height: 32px;
}

.pagination-button {
  font-size: 15px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input,
textarea {
  padding: 8px 10px;
}

select {
  padding: 7px 28px 7px 9px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 107, 75, 0.11);
}

.input-prefix {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}

.input-prefix > span {
  display: grid;
  place-items: center;
  align-self: stretch;
  color: var(--muted);
  background: var(--surface-alt);
  border-right: 1px solid var(--line);
}

.input-prefix input {
  border: 0;
  border-radius: 0;
}

.money-input {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(90px, 1.1fr);
  gap: 7px;
}

.rate-control {
  display: grid;
  grid-template-columns: minmax(75px, 1fr) auto;
  gap: 6px;
}

.rate-control input {
  min-height: 32px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.bounded-table-viewport {
  max-height: min(46vh, 440px);
  overflow: auto;
}

.bounded-table-viewport .data-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 1px 0 var(--line-strong);
}

.archive-table-viewport {
  max-height: min(54vh, 520px);
}

.order-table-viewport {
  height: min(65vh, 680px);
  min-height: 360px;
  overflow: auto;
}

.order-table-viewport .data-table thead {
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 1px 0 var(--line-strong);
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table.wide {
  min-width: 1600px;
}

.admin-order-table {
  min-width: 1510px;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  height: 42px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

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

.data-table tbody tr:hover td {
  background: #fbfcfa;
}

.cell-primary {
  font-weight: 700;
}

.cell-secondary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cell-truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-cell {
  color: var(--blue);
  text-decoration: none;
}

.link-cell:hover {
  text-decoration: underline;
}

.noninteractive-link-cell {
  color: var(--ink);
  cursor: default;
}

.copyable-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 5px;
}

.copy-value-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
  font-size: 15px;
  line-height: 1;
}

.copy-value-button:hover {
  color: var(--primary-dark);
  border-color: #9bc8b4;
  background: var(--green-bg);
}

.supplier-copy-reminder {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #d8bd83;
  border-left: 4px solid #c4871a;
  border-radius: 5px;
  color: var(--amber);
  background: var(--amber-bg);
}

.supplier-copy-reminder strong {
  flex: 0 0 auto;
}

.supplier-copy-reminder span {
  color: var(--ink);
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-control {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stacked-control {
  display: grid;
  gap: 6px;
}

.stacked-control select,
.stacked-control .compact-button {
  width: 100%;
}

.evidence-links,
.evidence-upload {
  display: grid;
  gap: 6px;
}

.evidence-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.evidence-link,
.evidence-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.evidence-upload-button {
  position: relative;
  overflow: hidden;
}

.evidence-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.evidence-upload-button:focus-within {
  border-color: var(--primary);
  outline: 2px solid rgba(18, 107, 75, 0.18);
  outline-offset: 1px;
}

.evidence-upload-button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.danger-button {
  color: var(--red);
  border-color: #e7b8b4;
  background: var(--red-bg);
}

.danger-button:hover {
  color: var(--red);
  border-color: var(--red);
  background: #f9dedb;
}

.pair-actions {
  align-items: stretch;
}

.notification-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}

.notification-status.configured {
  color: var(--green);
  font-weight: 700;
}

.evidence-upload small,
.evidence-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.locked-note {
  max-width: 230px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.archive-button {
  color: var(--amber);
  border-color: #d8bd83;
  background: var(--amber-bg);
}

.selected-row td {
  background: var(--green-bg) !important;
}

.archive-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 50px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.archive-summary strong {
  color: var(--ink);
}

.customer-order-group {
  padding: 18px 0 8px;
  border-top: 1px solid var(--line-strong);
}

.customer-order-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.customer-group-heading,
.pair-order-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.customer-group-heading {
  min-height: 52px;
  margin-bottom: 10px;
}

.customer-group-heading h3 {
  margin: 0;
  font-size: 18px;
}

.pair-order-block + .pair-order-block {
  margin-top: 18px;
}

.pair-order-heading {
  min-height: 42px;
  padding: 6px 2px;
}

.pair-order-heading > div,
.pair-order-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pair-order-heading span,
.pair-order-metrics {
  color: var(--muted);
  font-size: 12px;
}

.pair-order-metrics strong {
  color: var(--green);
}

.compact-empty {
  min-height: 120px;
}

.inline-control select {
  min-width: 104px;
  min-height: 32px;
}

.inline-control input {
  min-width: 190px;
  min-height: 32px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-title {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 4px;
}

.dialog {
  width: min(620px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(17, 26, 20, 0.42);
}

.dialog form {
  padding: 20px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog h2 {
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.dialog-actions.split-actions {
  justify-content: space-between;
}

.dialog-actions.split-actions > div {
  display: flex;
  gap: 8px;
}

.toast-root {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 36px));
}

.toast {
  padding: 11px 13px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 650;
}

.toast.error {
  color: var(--red);
  border-color: #e7b8b4;
  background: var(--red-bg);
}

.toast.success {
  color: var(--green);
  border-color: #b7d9c8;
  background: var(--green-bg);
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.error-code {
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
}

.error-page h1 {
  margin: 12px 0 4px;
  font-size: 20px;
}

.error-page p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .order-workbench {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .order-filter-toolbar {
    grid-template-columns: 1fr;
  }

  .order-search,
  .advanced-filter-row {
    grid-column: 1;
  }

  .advanced-filter-row {
    overflow-x: auto;
    overflow-y: visible;
  }

  .stats-grid.dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid.admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .topbar {
    height: 60px;
  }

  .topbar-inner,
  .page {
    width: min(100% - 24px, 1480px);
  }

  .page {
    padding-top: 20px;
  }

  .workspace-shell {
    min-height: calc(100vh - 60px);
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 60px;
    z-index: 16;
    min-height: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .app-sidebar-label {
    display: none;
  }

  .app-sidebar-nav {
    display: flex;
    gap: 5px;
  }

  .app-sidebar-link {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 6px 9px;
    white-space: nowrap;
  }

  .app-sidebar-logout {
    min-height: 36px;
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    white-space: nowrap;
  }

  .admin-shell .admin-page {
    padding: 20px 12px 48px;
  }

  .guide-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 22px;
  }

  .lark-guide-grid,
  .guide-note-list {
    grid-template-columns: 1fr;
  }

  .lark-guide-grid {
    gap: 26px;
  }

  .guide-heading h1 {
    font-size: 22px;
  }

  .supplier-copy-reminder {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .bounded-table-viewport,
  .archive-table-viewport {
    max-height: 52vh;
  }

  .page-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .page-heading h1 {
    font-size: 21px;
  }

  .page-heading .button {
    width: 100%;
  }

  .page-heading-actions {
    width: 100%;
  }

  .page-heading-actions .button {
    flex: 1 1 0;
  }

  .entry-panel {
    grid-template-columns: 1fr;
  }

  .entry-panel .button {
    width: 100%;
  }

  .order-workbench {
    grid-template-columns: 1fr;
  }

  .customer-sidebar {
    position: static;
    max-height: none;
  }

  .customer-sidebar nav {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .customer-list-item {
    width: auto;
    min-width: 150px;
    flex: 0 0 auto;
  }

  .workspace-heading,
  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-presets {
    width: 100%;
  }

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

  .advanced-filter-row {
    padding-bottom: 12px;
  }

  .filter-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .order-table-viewport {
    height: 62vh;
    min-height: 380px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .dialog-actions.split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions.split-actions > div,
  .dialog-actions.split-actions > button {
    width: 100%;
  }

  .dialog-actions.split-actions > div .button {
    flex: 1 1 0;
  }

  .brand-context {
    max-width: 150px;
  }

  .topbar-name {
    display: none;
  }

  .archive-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .customer-group-heading,
  .pair-order-heading,
  .pair-order-heading > div,
  .pair-order-metrics {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .pair-order-heading {
    padding-block: 10px;
  }
}

@media (max-width: 470px) {
  .stats-grid,
  .stats-grid.dense,
  .stats-grid.admin-summary {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    min-height: 96px;
    padding: 13px;
  }

  .stat-value {
    font-size: 22px;
  }

  .role-badge {
    display: none;
  }

  .language-button {
    min-width: 44px;
    padding-inline: 7px;
  }
}
