:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #21352f;
  background: #f3f5f3;
  font-synthesis: none;
  --green: #17634e;
  --dark: #173e36;
  --muted: #586c62;
  --line: #e2e8e3;
  --orange: #b26422;
  --focus: #177754;
  scrollbar-color: #8ba598 #edf1ee;
}
[hidden] {
  display: none !important;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
::selection {
  background: #d9eada;
  color: var(--dark);
}
a {
  color: var(--green);
  text-decoration: none;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--dark);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: #edf4ef;
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
form[aria-busy="true"] button:disabled {
  cursor: progress;
}
.primary,
button[type="submit"] {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.primary:hover,
button[type="submit"]:hover {
  background: #124d3d;
}
.danger {
  color: #ae3b38;
  border-color: #e8c7c7;
}
input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #d6dfd9;
  border-radius: 7px;
  color: #273e35;
  background: white;
  min-height: 44px;
  font-size: 14px;
  caret-color: var(--green);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea {
  min-height: 85px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  accent-color: var(--green);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.sidebar :focus-visible {
  outline-color: #edda99;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
form {
  display: grid;
  gap: 16px;
}
.check,
.address-ack {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 400;
  line-height: 1.6;
  min-height: 44px;
}
.check input,
.address-ack input {
  flex-shrink: 0;
  margin-top: 3px;
}
.muted,
small {
  color: var(--muted);
}
small {
  display: block;
  line-height: 1.6;
  font-size: 12px;
}
.initial {
  padding: 50px;
}
.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 20;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--dark);
  color: #d6e8df;
  padding: 27px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: white;
  margin: 0 11px 31px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border: 1px solid #6c9886;
  border-radius: 11px;
  font-weight: 700;
  font-size: 24px;
  background: #245344;
}
.brand strong {
  display: block;
  letter-spacing: 2.5px;
  font-size: 18px;
}
.brand small {
  color: #afcbbb;
  font-size: 10px;
  letter-spacing: 1.2px;
  margin-top: 3px;
}
.nav-label {
  font-size: 11px;
  letter-spacing: 1.7px;
  color: #89ad9d;
  padding: 10px 12px;
}
.nav {
  display: grid;
  gap: 4px;
}
.nav a {
  color: #c4dbce;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  font-size: 13px;
  border-radius: 8px;
}
.nav a:hover {
  background: #245045;
  text-decoration: none;
}
.nav a.active {
  background: #e0eee5;
  color: #1a493b;
  font-weight: 700;
}
.nav svg {
  width: 18px;
  height: 18px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 25px 12px 0;
  border-top: 1px solid #386052;
  font-size: 12px;
  line-height: 1.8;
}
.sidebar-bottom a {
  color: #e0eee5;
}
.workspace {
  min-width: 0;
}
.topbar {
  min-height: 73px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 34px;
  gap: 16px;
}
.topbar .subtle {
  font-size: 12px;
  color: var(--muted);
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-width: 0;
}
.profile .user-name {
  min-width: 0;
  max-width: 32ch;
  overflow-wrap: anywhere;
}
.avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf0e8;
  font-weight: 700;
  color: var(--green);
}
.profile button {
  flex-shrink: 0;
  border: 0;
  padding: 5px;
  color: var(--muted);
  font-size: 12px;
}
.mobile-menu {
  display: none;
}
.content {
  padding: 30px 34px 45px;
  max-width: 1800px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 23px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.6px;
  line-height: 1.2;
  margin: 0 0 9px;
}
h2 {
  font-size: 16px;
  letter-spacing: -0.2px;
  margin: 0 0 5px;
}
h3 {
  font-size: 15px;
  margin: 0 0 13px;
}
h4 {
  margin: 8px 0;
}
p {
  line-height: 1.6;
}
.page-heading p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 11px;
  margin-bottom: 22px;
}
.filters label {
  font-size: 13px;
  min-width: 180px;
  flex: 1;
}
.filters .search {
  min-width: 220px;
  flex: 2;
}
.filters button {
  flex-shrink: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 23px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 20px 22px;
  position: relative;
}
.metric .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
}
.metric .number {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.metric:first-child {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}
.metric:first-child .label,
.metric:first-child small {
  color: #bbd7c7;
}
.metric small {
  font-size: 12px;
}
.metric .mini-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #89a99a;
}
.metric .mini-icon svg {
  width: 16px;
  height: 16px;
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 22px;
  margin-bottom: 23px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 22px;
}
.grid-two .panel {
  margin-bottom: 0;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 21px 22px;
  border-bottom: 1px solid var(--line);
}
.panel-body {
  padding: 22px;
}
.panel-header a {
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
  width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
th {
  padding: 13px 18px;
  background: #f4f7f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 18px;
  border-bottom: 1px solid #edf0ec;
  line-height: 1.5;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fafcf9;
}
.right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.id-link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 25px;
  color: var(--green);
  font-size: 12px;
  justify-content: flex-start;
  text-align: left;
}
.id-link:hover {
  background: none;
  text-decoration: underline;
}
.name-cell {
  min-width: 180px;
  white-space: normal;
  max-width: 300px;
}
.badge {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
  background: #edf1ee;
  color: #52675a;
}
.badge:before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.badge.paid,
.badge.ok,
.badge.done,
.badge.complete {
  background: #e8f3eb;
  color: #22744f;
}
.badge.pending,
.badge.waiting,
.badge.low,
.badge.browser_pending {
  background: #fff1dd;
  color: #85510d;
}
.badge.review,
.badge.error,
.badge.out,
.badge.unknown,
.badge.stale {
  background: #fcebe6;
  color: #9c412c;
}
.badge.shipped {
  background: #e8f0fb;
  color: #486b9f;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pagination button {
  min-height: 44px;
  padding: 6px 10px;
}
.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}
.empty strong {
  display: block;
  color: var(--dark);
  margin-bottom: 4px;
  font-size: 16px;
}
.chart {
  height: 210px;
  display: flex;
  align-items: flex-end;
  gap: clamp(3px, 0.6vw, 12px);
  padding: 18px 6px 25px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.chart-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  gap: 6px;
}
.chart-bar {
  width: 100%;
  max-width: 28px;
  background: #86ae96;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.chart-col:last-child .chart-bar {
  background: var(--green);
}
.chart-col span {
  position: absolute;
  bottom: -23px;
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}
.chart-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 17px;
}
.status-list {
  display: grid;
  gap: 22px;
}
.status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 12px;
}
.progress {
  grid-column: 1/-1;
  height: 6px;
  background: #f0f3ef;
  border-radius: 5px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: #9ab6a2;
  border-radius: 5px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.connection .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56a16c;
}
.connection .dot.warn {
  background: #c28c3a;
}
.footnote {
  font-size: 11px;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.7;
}
.warning,
.packing-warning {
  background: #fff7e7;
  border: 1px solid #e0c99f;
  color: #8c672c;
  padding: 12px 15px;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 4px;
}
.error {
  background: #fcebe8;
  color: #a23e31;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.product-thumb {
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f6f1;
  display: inline-grid;
  place-items: center;
  margin-right: 10px;
  color: #65816c;
  font-size: 16px;
  vertical-align: middle;
}
.login {
  max-width: 400px;
  margin: 10vh auto;
  background: white;
  padding: 36px;
  border-radius: 18px;
  border: 1px solid var(--line);
}
.login .brand {
  margin: 0 0 26px;
  color: var(--dark);
}
.login .brand small {
  color: var(--muted);
}
.login h1 {
  font-size: 23px;
}
.login p {
  font-size: 13px;
  color: var(--muted);
}
.login form {
  margin-top: 25px;
}
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(920px, 95vw);
  max-width: 95vw;
  border: 0;
  padding: 0;
  box-shadow: -10px 0 60px #173e3622;
  color: #21352f;
  background: #f6f8f4;
}
dialog::backdrop {
  background: #13251d66;
  backdrop-filter: blur(2px);
}
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  font-size: 20px;
}
.drawer-body {
  padding: 26px;
}
.drawer-body section,
.drawer-body .shipping-card,
.packing-summary,
.order-invoice {
  display: block;
  background: white;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.drawer-body details {
  margin: 14px 0;
}
.drawer-body summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.drawer-body form {
  margin-top: 16px;
}
.drawer-body .grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.drawer-body fieldset {
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 8px;
  display: grid;
  gap: 12px;
}
.drawer-body legend {
  font-size: 12px;
}
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  font-size: 13px;
}
.facts dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.order-invoice-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 18px;
}
.order-invoice-heading span {
  color: var(--green);
}
.order-invoice-scroll {
  overflow: auto;
}
.order-invoice-items {
  font-size: 12px;
}
.order-invoice-items td,
.order-invoice-items th {
  padding: 10px 8px;
}
.order-invoice-items caption {
  text-align: left;
  font-size: 11px;
  padding: 10px 0;
  color: var(--muted);
}
.invoice-mobile-meta {
  display: none;
}
.order-invoice-totals {
  max-width: 480px;
  margin: 20px 0 0 auto;
}
.order-invoice-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  font-size: 12px;
}
.order-invoice-line strong {
  white-space: nowrap;
}
.order-invoice-hint,
.order-invoice-payment-note {
  font-size: 11px;
  color: var(--muted);
}
.order-invoice-grandtotal {
  font-size: 17px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
}
.file {
  display: block;
  font-size: 12px;
  padding: 8px 0;
}
.shipping-evidence {
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
  font-size: 12px;
}
.cart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 44px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.cart-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cart-row input {
  min-width: 0;
}
.cart-row button {
  padding: 4px;
  min-height: 44px;
}
.cart-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.notice {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 10000;
  max-width: min(450px, 90vw);
  padding: 15px 22px;
  border-radius: 10px;
  background: var(--dark);
  color: white;
  box-shadow: 0 6px 28px #0002;
  font-size: 13px;
  line-height: 1.6;
}
.notice.fail {
  background: #963e32;
}
.inline-result {
  font-size: 12px;
  line-height: 1.7;
}
.audit-list {
  font-size: 12px;
  line-height: 2;
}
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.settings-grid .panel {
  margin-bottom: 0;
}
.loading {
  padding: 50px;
  color: var(--muted);
  font-size: 13px;
}
.loading:before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #b3cabd;
  border-right-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 12px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading:before {
    animation: none;
  }
}
@media (min-width: 1600px) {
  .content {
    padding: 38px 48px;
  }
  .metric {
    padding: 25px;
  }
  .metric .number {
    font-size: 32px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    padding: 25px 12px;
  }
  .content {
    padding: 25px 22px;
  }
  .topbar {
    padding-inline: 22px;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .metric .number {
    font-size: 23px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 15;
    width: 230px;
    box-shadow: 10px 0 30px #0003;
  }
  .shell.menu-open .sidebar {
    display: flex;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    min-height: 65px;
    height: auto;
    padding: 10px 15px;
  }
  .topbar .subtle {
    display: none;
  }
  .content {
    padding: 24px 15px;
  }
  .page-heading {
    flex-wrap: wrap;
    gap: 15px;
  }
  h1 {
    font-size: 25px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric .number {
    font-size: 23px;
  }
  .metric .mini-icon {
    display: none;
  }
  .metric .label {
    font-size: 11px;
  }
  .filters {
    gap: 10px;
    padding: 13px;
  }
  .filters label,
  .filters .search {
    min-width: min(100%, max(180px, calc(50% - 10px)));
  }
  .filters .search {
    flex-basis: 100%;
  }
  .filters > button {
    flex: 1 1 calc(50% - 5px);
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .drawer-head,
  .drawer-body {
    padding: 20px;
  }
  .drawer-body section,
  .packing-summary,
  .drawer-body .shipping-card {
    padding: 16px;
  }
  .drawer-body .grid,
  .form-grid,
  .facts {
    grid-template-columns: 1fr;
  }
  dialog {
    width: 100vw;
    max-width: 100vw;
  }
  .profile .user-name {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .panel-header {
    padding: 18px;
  }
  .grid-two {
    gap: 18px;
  }
  .pagination {
    padding: 12px;
  }
  .order-invoice-items {
    font-size: 11px;
  }
  .order-invoice-totals {
    max-width: none;
  }
  .chart {
    height: 170px;
  }
}

/* Phone and tablet navigation keeps focus inside the open menu. */
.menu-backdrop,
.sidebar-close {
  display: none;
}
@media (max-width: 1024px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 15;
    box-shadow: 10px 0 30px #0003;
  }
  .shell.menu-open .sidebar {
    display: flex;
  }
  .mobile-menu {
    display: inline-flex;
  }
  body:has(.shell.menu-open) {
    overflow: hidden;
  }
  .shell.menu-open .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 14;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #13251d66;
    cursor: pointer;
  }
  .sidebar {
    height: 100dvh;
    max-height: 100dvh;
    width: min(280px, calc(100vw - 48px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar-close {
    display: inline-flex;
    align-self: flex-start;
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    padding: 0;
    margin: -12px 0 12px;
    background: transparent;
    border-color: #6c9886;
    color: #e0eee5;
    line-height: 1;
  }
  .sidebar-close:hover {
    background: #245045;
  }
}

/* Product editor follows the familiar information / description / branch workflow. */
.local-notice {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #e8f3eb;
  border: 1px solid #cadfd1;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.local-notice span {
  flex: 1;
  min-width: 220px;
  color: #456454;
}
.local-product-drawer {
  width: min(1160px, calc(100vw - 32px));
  max-width: 1160px;
}
.local-product-drawer .drawer-body {
  padding: 22px;
}
.local-editor-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #dce6df;
  margin-bottom: 24px;
}
.local-editor-tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 13px 4px;
  border-bottom: 3px solid transparent;
}
.local-editor-tabs button[aria-selected="true"] {
  border-color: #1b6c4f;
  color: #155a42;
  font-weight: 750;
}
.local-product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 30px;
}
.local-product-form label {
  display: block;
  margin-bottom: 16px;
}
.local-product-form input:not([type="checkbox"]),
.local-product-form textarea,
.local-product-form select,
.local-count-form input:not([type="checkbox"]) {
  width: 100%;
  margin-top: 6px;
}
.local-photo {
  background: #f7faf7;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  align-self: start;
}
.local-photo img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 14px;
}
.local-photo input {
  font-size: 12px;
  max-width: 100%;
}
.local-photo p {
  font-size: 12px;
  color: #637a6b;
}
.local-editor-box {
  border: 1px solid #dfe6e0;
  border-radius: 12px;
  padding: 18px;
  margin-top: 20px;
}
.local-editor-box h3 {
  font-size: 16px;
  margin: 0 0 14px;
}
.local-editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
  border-top: 1px solid #dce6df;
  padding: 16px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.local-editor-footer .check {
  margin: 0;
  flex: 1;
}
.local-editor-footer .inline-result {
  flex-basis: 100%;
}
.local-count-area {
  margin-top: 22px;
  border-top: 1px solid #dce6df;
  padding-top: 24px;
}
.local-count-form {
  padding: 20px;
  border: 1px solid #cadfd1;
  border-radius: 12px;
  margin: 12px 0;
  background: #f8fbf8;
}
.local-count-form h4 {
  margin-top: 0;
}
.local-count-form small {
  display: block;
  font-weight: 400;
  margin-top: 4px;
}
.local-count-form label {
  display: block;
  margin: 12px 0;
}
.local-count-form .check,
.local-product-form .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.local-count-form input[type="checkbox"],
.local-product-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.local-inventory-reminder {
  padding: 14px;
  background: #fff6dc;
  border-radius: 8px;
}
.local-product-form [hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .local-product-drawer {
    width: 100%;
    max-width: 100%;
    margin: auto 0;
    border-radius: 14px 14px 0 0;
    max-height: 95dvh;
  }
  .local-product-drawer .drawer-body {
    padding: 16px;
  }
  .local-product-grid {
    grid-template-columns: 1fr;
  }
  .local-photo {
    max-width: 220px;
  }
  .local-editor-tabs {
    gap: 6px;
  }
  .local-editor-tabs button {
    font-size: 13px;
    flex: 1;
  }
  .local-editor-footer .actions {
    width: 100%;
  }
  .local-editor-footer .actions button {
    flex: 1;
    min-height: 44px;
  }
  .local-editor-footer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .local-count-form .form-grid {
    grid-template-columns: 1fr;
  }
}

.local-editor-footer .inline-result:empty {
  display: none;
}
.local-editor-footer .actions {
  margin-left: auto;
  justify-content: flex-end;
}

.local-count-area[hidden] {
  display: none !important;
}
body:has(dialog.local-product-drawer[open]) {
  overflow: hidden;
}

/* Keep the inventory comparison action column within the drawer. */
.inventory-comparison-wrap {
  max-width: 100%;
  margin-top: 14px;
}
.inventory-comparison-table {
  table-layout: fixed;
  width: 100%;
  white-space: normal;
}
.inventory-comparison-table .comparison-product-col {
  width: 35%;
}
.inventory-comparison-table .comparison-number-col {
  width: 7%;
}
.inventory-comparison-table .comparison-stock-col {
  width: 12%;
}
.inventory-comparison-table .comparison-action-col {
  width: 18%;
}
.inventory-comparison-table th,
.inventory-comparison-table td {
  padding: 14px 10px;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.inventory-comparison-table td[data-label] {
  font-variant-numeric: tabular-nums;
}
.inventory-comparison-table .comparison-action button {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  line-height: 1.5;
  min-height: 44px;
  padding: 10px;
}
@media (max-width: 760px) {
  .inventory-comparison-table,
  .inventory-comparison-table tbody {
    display: block;
  }
  .inventory-comparison-table colgroup,
  .inventory-comparison-table thead {
    display: none;
  }
  .inventory-comparison-table tbody {
    display: grid;
    gap: 14px;
  }
  .inventory-comparison-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
  }
  .inventory-comparison-table td {
    display: block;
    min-width: 0;
    padding: 10px 0;
    border: 0;
  }
  .inventory-comparison-table td[data-label] {
    padding-right: 10px;
  }
  .inventory-comparison-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
  }
  .inventory-comparison-table .comparison-product,
  .inventory-comparison-table .comparison-status,
  .inventory-comparison-table .comparison-action {
    grid-column: 1/-1;
  }
  .inventory-comparison-table .comparison-product {
    padding-top: 0;
    font-weight: 600;
  }
  .inventory-comparison-table .comparison-action {
    padding-bottom: 0;
  }
}

/* Keep all admin drawers aligned when the document has a scrollbar. */
body:has(dialog[open]) {
  overflow: hidden;
}
.drawer-head {
  gap: 16px;
}
.drawer-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.drawer-head > button {
  flex-shrink: 0;
}
.drawer-body :is(label, fieldset, .cart-picker > *),
.form-grid > * {
  min-width: 0;
}
.drawer-body :is(p, small, .warning, .inline-result) {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  dialog {
    width: 100%;
    max-width: 100%;
  }
  .pagination {
    flex-wrap: wrap;
  }
  .pagination > .actions {
    margin-left: auto;
  }
}

/* Date controls have a browser intrinsic width; allow them to fit their grid cell. */
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
}
/* Operational health is independent from liveness and fits the existing panels. */
.vc-operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}
.vc-operation-card {
  min-width: 0;
  border: 1px solid #dce7df;
  border-radius: 12px;
  background: #f7faf7;
  padding: 18px;
  overflow-wrap: anywhere;
}
.vc-operation-card h3 {
  font-size: 13px;
  color: #64756c;
  margin: 0 0 10px;
}
.vc-operation-card strong {
  font-size: 18px;
  color: #174d39;
}
.vc-operation-card p {
  font-size: 13px;
  line-height: 1.65;
  margin: 10px 0 0;
}
.vc-operation-card.is-warning {
  background: #fff9ec;
  border-color: #ead9ae;
}

/* Funds under review cannot be spent even when present in the ledger. */
.wallet-balances {
  font-variant-numeric: tabular-nums;
}
.wallet-balances a {
  white-space: normal;
  overflow-wrap: anywhere;
}
form[aria-busy="true"] {
  cursor: progress;
}

/* Work queues prioritize the source, current owner and next permitted action. */
.work-list {
  display: grid;
  gap: 16px;
  margin-block: 20px;
}
.work-item {
  min-width: 0;
  padding: 20px;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.work-item header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.work-item header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.work-item .badge {
  flex-shrink: 0;
  white-space: normal;
}
.work-item-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.work-item-actions form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.work-item .inline-result:empty {
  display: none;
}
.work-item details {
  margin-top: 16px;
}
.work-item details form {
  margin-top: 16px;
}
fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
legend {
  font-weight: 600;
  padding-inline: 6px;
}
summary {
  min-height: 44px;
  padding-block: 11px;
  cursor: pointer;
}
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.id-link {
  min-height: 44px;
  min-width: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.nav a,
.sidebar-bottom a {
  min-height: 44px;
}
.sidebar-bottom a {
  display: inline-flex;
  align-items: center;
}
@media (max-width: 760px) {
  .work-item {
    padding: 16px;
  }
  .work-item header {
    display: grid;
    gap: 12px;
  }
  .work-item .badge {
    justify-self: start;
  }
  .work-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .work-item-actions > * {
    min-width: 0;
  }
  .work-item-actions form {
    display: grid;
  }
  .work-item-actions button {
    width: 100%;
  }
  .table-wrap:has(> .admin-data-table) {
    overflow: visible;
    background: transparent;
  }
  .admin-data-table,
  .admin-data-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .admin-data-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }
  .admin-data-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fffef9;
  }
  .admin-data-table td {
    display: block;
    min-width: 0;
    border: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .admin-data-table td:first-child,
  .admin-data-table td.name-cell,
  .admin-data-table td.wallet-balances {
    grid-column: 1/-1;
  }
  .admin-data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .admin-data-table td:first-child .id-link {
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }
  .admin-data-table .product-thumb {
    flex-shrink: 0;
  }
  .admin-data-table .badge {
    max-width: 100%;
    white-space: normal;
  }
}
.sales-products{display:grid;gap:8px;height:152px;box-sizing:border-box;overflow:auto;margin:12px 0;background:#f3f6f9;border:2px solid #b4232d;border-radius:12px;padding:8px}
button.sales-product{width:100%;display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:center;gap:12px;text-align:left;padding:12px;background:white;color:#142638;border:1px solid #e1e7ec;border-radius:10px;min-height:84px}
.sales-info{display:grid;gap:5px;overflow-wrap:anywhere}.sales-info small{color:#4c5969}.sales-info b,.sales-plus{color:#075bb7}.sales-plus{font-size:23px;text-align:center}.sales-meta{display:flex;flex-wrap:wrap;gap:6px}.sales-meta span{background:#edf1f5;padding:2px 6px;border-radius:4px;font-size:12px}.sales-meta .sold{background:#ffe8e7;color:#a6211b}.cart-picker[hidden]{display:none!important}
.sales-cart-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px 4px;border-bottom:1px solid #e3e9ef;overflow-wrap:anywhere}.sales-cart-row small{display:block;color:#075bb7;margin-top:4px}.sales-qty{display:flex;align-items:center;border:1px solid #aab8c6;border-radius:10px;overflow:hidden}.sales-qty button,.sales-qty input{min-width:40px;min-height:42px;border:0;border-radius:0;padding:0;text-align:center}.sales-qty input{width:46px;appearance:textfield}.sales-qty input::-webkit-inner-spin-button,.sales-qty input::-webkit-outer-spin-button{appearance:none;margin:0}.sales-checkout{position:sticky;bottom:0;background:#fff;border-top:1px solid #dce4ec;box-shadow:0 -6px 15px #172b3810;padding:12px 2px calc(8px + env(safe-area-inset-bottom,0px));z-index:2}.sales-checkout #sales-total{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}.sales-checkout button{width:100%;min-height:44px;background:#075bb7;color:white}
#drawer:has(.sales-compose) .drawer-head {
  padding: 8px 16px;
  gap: 8px;
}
#drawer:has(.sales-compose) .drawer-head h2 {
  margin: 0;
  font-size: 17px;
}
#drawer:has(.sales-compose) .drawer-head > button {
  min-height: 44px;
  min-width: 44px;
  padding: 4px;
}
#drawer:has(.sales-compose) .drawer-body {
  padding: 12px;
}
#drawer .drawer-body > section:has(> .sales-compose) {
  padding: 12px;
  margin-bottom: 0;
}
#drawer .sales-compose {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}
#drawer .sales-compose > * {
  grid-column: 1 / -1;
  min-width: 0;
}
#drawer .sales-compose > label:has(> [name="customerId"]) {
  grid-column: 1;
}
#drawer .sales-compose > label:has(> [name="orderType"]) {
  grid-column: 2;
}
#drawer .sales-compose label {
  gap: 3px;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}
#drawer .sales-compose select,
#drawer .sales-compose #product-search {
  min-height: 44px;
  padding: 5px 8px;
  margin: 0;
}
#drawer .sales-compose #selected-address {
  font-size: 12px;
  line-height: 1.3;
  margin: 4px 0;
  overflow-wrap: anywhere;
}
#drawer .sales-compose #compose-addresses .check {
  min-height: 34px;
  align-items: center;
}
#drawer .sales-products {
  margin: 0;
}
@media (max-width: 760px) {
  #drawer:has(.sales-compose) .drawer-head {
    padding-inline: 12px;
  }
  #drawer:has(.sales-compose) .drawer-body,
  #drawer .drawer-body > section:has(> .sales-compose) {
    padding: 8px;
  }
  #drawer .sales-compose {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
  }
  #drawer .sales-compose select,
  #drawer .sales-compose #product-search {
    font-size: 16px;
  }
  #drawer .sales-products {
    padding: 5px;
    gap: 5px;
  }
  #drawer .sales-product {
    min-height: 72px;
    padding: 7px;
    gap: 8px;
  }
  #drawer .sales-checkout {
    margin: 0 -2px;
    padding-top: 8px;
  }
}

.sales-products {
  grid-auto-rows: max-content;
  align-content: start;
}
.sales-product .sales-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 8px;
}
.sales-product .sales-price {
  color: #075bb7;
  font-size: 1.125rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#drawer .selected-order-items {
  margin: 12px 0 16px;
  padding: 0 12px 4px;
  border: 2px solid #187353;
  border-radius: 12px;
  background: #eef8f1;
}
#drawer .selected-order-items h3 {
  margin: 0 -12px;
  padding: 10px 12px;
  border-radius: 9px 9px 0 0;
  background: #187353;
  color: #fff;
  font-size: 16px;
}
#drawer .selected-order-items .sales-qty {
  background: #fff;
}
#drawer .selected-order-items > :last-child {
  border-bottom: 0;
}

#drawer button[data-command="save-order-draft"] {
  color: #a61e2a;
  background: #fff0f1;
  border-color: #c63743;
  font-weight: 800;
}
#drawer button[data-command="save-order-draft"]:is(:hover, :focus-visible):not(:disabled) {
  color: #831724;
  background: #ffe0e4;
}

.sales-customer-search { min-width: 0; position: relative; }
#drawer .sales-customer-search input[type="search"] { width: 100%; min-height: 38px; }
.sales-customer-results:not(:empty) {
  position: absolute; z-index: 3; top: 100%; left: 0; right: 0;
  display: grid; gap: 4px; max-height: 230px; overflow: auto;
  padding: 6px; background: #fff; border: 1px solid #9db4ac;
  border-radius: 8px; box-shadow: 0 6px 18px #163e3826;
}
.sales-customer-results button { text-align: left; overflow-wrap: anywhere; min-height: 38px; }

.advisor-saved-drafts { margin: 0 0 20px; padding: 16px; background: white; border: 1px solid #d8e2dc; border-radius: 12px; }
#content:not([data-advisor-view="sales"]) .advisor-saved-drafts,
#advisor-sales-open[hidden] + .advisor-saved-drafts { display: none; }
.advisor-saved-drafts h2 { margin: 0 0 12px; font-size: 1.15rem; }
.advisor-saved-draft-rows { display: grid; gap: 8px; }
.advisor-saved-draft-rows button { display: grid; gap: 3px; text-align: left; padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.advisor-saved-draft-rows small { color: #52655d; }
