:root {
  color-scheme: light;
  --brand: #22bf64;
  --brand-hover: #1caa58;
  --brand-light: #f4fcf7;
  --canvas: #f7f7fa;
  --border: #ebeef5;
  --field-border: #dcdfe6;
  --ink: #303133;
  --muted: #606266;
  --subtle: #909399;
  --danger: #f56c6c;
  --sidebar-width: 180px;
  --header-height: 50px;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--brand-hover); text-decoration: none; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: 32px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: #a5a8af; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
select { padding-right: 28px; }
textarea { resize: vertical; }

.button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}
.button:hover { border-color: #b7e6c9; color: var(--brand-hover); }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.button.link { min-height: 26px; padding: 2px 4px; border: 0; background: none; color: var(--brand-hover); }
.button.link:hover { text-decoration: underline; }
.button.danger, .button.link.danger { color: #d84444; }

.console-app { --nav-width: var(--sidebar-width); }
.console-app.nav-collapsed { --nav-width: 36px; }
.console-header {
  position: fixed;
  z-index: 4;
  inset: 0 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--canvas);
}
.console-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 var(--nav-width);
  height: 100%;
  padding-left: 16px;
  overflow: hidden;
  white-space: nowrap;
  color: #222;
  border-right: 1px solid var(--canvas);
}
.console-brand strong { font-size: 20px; font-weight: 700; color: var(--brand-hover); }
.console-brand span { font-weight: 600; }
.merchant-avatar { display: none; }
.nav-toggle.button { height: 100%; min-width: 38px; padding: 0 10px; border: 0; border-radius: 0; }
.console-breadcrumb {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.console-breadcrumb a { color: var(--ink); font-weight: 600; }
.console-breadcrumb a:hover { color: var(--brand-hover); }
.console-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 35px 0 12px;
  color: #505050;
}
.merchant-field { display: flex; align-items: center; gap: 8px; }
.merchant-field select { max-width: 190px; }
.console-account {
  padding: 2px 6px;
  border: 1px solid #e4e4e4;
  border-radius: 2px;
  background: #f8f8fa;
  font-size: 12px;
  white-space: nowrap;
}
.console-account:empty { display: none; }
.merchant-shortcuts { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.merchant-shortcuts a { color: var(--muted); }
.merchant-shortcuts a:hover { color: var(--brand-hover); }
.merchant-account-menu { position: relative; }
.merchant-account-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 230px;
  min-height: 34px;
  padding: 4px 7px;
  color: var(--muted);
  list-style: none;
}
.merchant-account-menu > summary::-webkit-details-marker { display: none; }
.merchant-account-menu > summary::after {
  flex: 0 0 6px;
  height: 6px;
  border: solid var(--subtle);
  border-width: 0 1px 1px 0;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}
.merchant-account-menu[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.merchant-account-menu > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-account-menu > div {
  position: absolute;
  top: calc(100% + 3px);
  right: 0;
  min-width: 140px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}
.merchant-account-menu a, .merchant-account-menu button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  background: #fff;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}
.merchant-account-menu :is(a, button):hover { background: var(--brand-light); color: var(--brand-hover); }
.merchant-account-menu :is(a, button):focus-visible { outline-offset: -2px; }
.console-sidebar {
  position: fixed;
  z-index: 3;
  inset: var(--header-height) auto 0 0;
  width: var(--nav-width);
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--canvas);
  scrollbar-width: thin;
}
.console-sidebar nav { padding: 5px 0 16px; }
.nav-group > summary, .nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 14px 0 16px;
  border-left: 4px solid transparent;
  color: #000;
  white-space: nowrap;
  font-weight: 600;
}
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border: solid #909399;
  border-width: 0 1px 1px 0;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}
.nav-group[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.nav-icon { display: inline-flex; width: 15px; justify-content: center; color: #b2bdcb; }
.nav-group .nav-item { min-height: 37px; padding-left: 47px; color: #5d5d5d; font-weight: 400; }
.nav-group > summary:hover, .nav-item:hover { background: #fafbfc; color: var(--brand-hover); }
.nav-item[aria-current=page], .nav-item.active {
  border-left-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-hover);
}
.nav-item[aria-current=page] .nav-icon, .nav-item.active .nav-icon { color: var(--brand); }
.console-app[data-role=merchant] .nav-group:has(.nav-item[aria-current=page]) > summary,
.console-app[data-role=merchant] .nav-group:has(.nav-item[aria-current=page]) > summary .nav-icon { color: var(--brand-hover); }
@media (min-width: 761px) {
  .console-app[data-role=merchant]:not(.nav-collapsed) .console-brand { justify-content: center; padding: 0; }
  .console-app[data-role=merchant]:not(.nav-collapsed) .console-brand strong { display: none; }
  .console-app[data-role=merchant]:not(.nav-collapsed) .merchant-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-hover);
    font-size: 20px;
  }
  .console-app[data-role=merchant]:not(.nav-collapsed) :is(.nav-group > summary, .console-sidebar nav > .nav-item) { min-height: 56px; }
  .console-app[data-role=merchant]:not(.nav-collapsed) .nav-group .nav-item { min-height: 50px; }
}
@media (min-width: 761px) {
  .nav-collapsed .console-brand { flex-basis: 112px; padding-left: 12px; }
  .nav-collapsed .console-brand strong { font-size: 18px; }
  .nav-collapsed .console-sidebar {
    border-right: 0;
    box-shadow: inset -1px 0 var(--canvas);
    scrollbar-width: none;
  }
  .nav-collapsed .console-sidebar::-webkit-scrollbar { display: none; }
  .nav-collapsed .console-sidebar nav { padding: 0; }
  .nav-collapsed .nav-group > summary,
  .nav-collapsed .console-sidebar nav > .nav-item {
    position: relative;
    justify-content: center;
    gap: 0;
    height: 56px;
    padding: 0;
    border-left: 0;
  }
  .nav-collapsed .nav-group > summary::after { display: none; }
  .nav-collapsed .nav-group > summary .nav-label,
  .nav-collapsed .console-sidebar nav > .nav-item .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .nav-collapsed .nav-icon {
    width: 18px;
    font-size: 16px;
    line-height: 1;
  }
  .nav-collapsed .nav-group[open] > summary .nav-icon,
  .nav-collapsed .nav-group:has([aria-current=page]) > summary .nav-icon { color: var(--brand); }
  .nav-collapsed .console-sidebar :focus-visible { outline-offset: -2px; }
  .nav-collapsed .nav-group[open] > .nav-links {
    position: fixed;
    z-index: 1;
    top: max(var(--header-height), calc(var(--flyout-top, var(--header-height)) + var(--flyout-offset, 0px)));
    left: var(--nav-width);
    width: 200px;
    max-height: calc(100dvh - var(--header-height));
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    box-shadow: 0 3px 12px rgb(0 0 0 / 12%);
  }
  .nav-collapsed .nav-links .nav-item {
    min-height: 56px;
    padding: 0 20px;
    border-left: 0;
  }
  .nav-collapsed .nav-links .nav-item[aria-current=page] {
    background: #ccc;
    color: var(--brand-hover);
  }
}
.console-content {
  height: calc(100dvh - var(--header-height));
  margin: var(--header-height) 0 0 var(--nav-width);
  overflow: auto;
  padding: 18px 20px 32px;
}
#console-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; line-height: 26px; }
.panel {
  min-width: 0;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}
.panel h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.panel p:first-child { margin-top: 0; }
.application-center {
  padding: clamp(16px, 3vw, 28px);
}
.application-center > section + section { margin-top: 28px; }
.application-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.application-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.application-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.application-card h3 { margin: 0; font-size: 15px; }
.application-card h3 a { color: var(--ink); }
.application-card h3 a:hover { color: var(--brand-hover); text-decoration: underline; }
.application-card p { margin: 6px 0 8px; color: var(--muted); }
.application-card small { color: var(--muted); }
.application-badge { color: #9c5511; font-size: 12px; }
@media (max-width: 639px) {
  .application-grid { grid-template-columns: minmax(0, 1fr); }
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.toolbar input:not([type=checkbox]):not([type=radio]) { width: 172px; }
.toolbar input[type=date] { width: auto; }
.toolbar:empty { display: none; }
.toolbar[data-commission-filter] input[type=datetime-local] { width: auto; }
.commission-staff-filter { display: inline-flex; align-items: center; gap: 6px; }
.commission-staff-filter details { position: relative; }
.order-spec-options fieldset { border: 1px solid var(--border); margin: 0 0 12px; }
.order-spec-options label { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.order-spec-options input[type=number] { width: 5em; }
.commission-staff-filter summary { cursor: pointer; }
.commission-staff-options {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 4px) auto auto 0;
  min-width: 160px;
  max-height: 220px;
  padding: 8px 12px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}
.toolbar .commission-staff-options label { display: flex; min-height: 30px; }
.form-error { color: #b92f2f; }
.field-note, .report-note { margin: 0 0 12px; color: var(--subtle); font-size: 13px; }
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.page-tabs .button {
  min-height: 36px;
  margin-bottom: -1px;
  padding: 4px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
}
.page-tabs .active, .page-tabs [aria-pressed=true] { border-bottom-color: var(--brand); color: var(--brand-hover); }
.desk-base-settings { display: grid; align-items: start; gap: 14px; max-width: 650px; }
.desk-base-settings > label { display: grid; grid-template-columns: minmax(125px, 180px) minmax(110px, 240px); align-items: center; gap: 12px; }
.desk-base-settings input[type=checkbox] { justify-self: start; }
.desk-base-settings .field-note { margin: -8px 0 0; }
.desk-unpaid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.logistics-panel { min-height: 560px; padding: 22px clamp(16px, 3vw, 40px); }
.logistics-panel > h2 { margin: 0 0 18px; color: var(--ink); font-size: 20px; font-weight: 600; }
.logistics-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 15px;
  padding: 4px;
  border-radius: 4px;
  background: var(--canvas);
}
.logistics-tabs button { padding: 8px 18px; border: 0; color: var(--ink); background: transparent; }
.logistics-tabs [aria-selected=true] { background: #fff; font-weight: 600; }
.logistics-cards { display: flex; flex-wrap: wrap; gap: 14px; }
.logistics-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: min(100%, 400px);
  padding: 14px;
  border-radius: 4px;
  background: var(--canvas);
}
.logistics-avatar {
  display: grid;
  min-height: 64px;
  place-items: center;
  border-radius: 6px;
  color: var(--brand-hover);
  background: var(--brand-light);
}
.logistics-card p { margin: 4px 0; overflow-wrap: anywhere; }
.logistics-card small { color: var(--subtle); }
.logistics-card details { position: relative; text-align: right; white-space: nowrap; }
.logistics-card summary { color: var(--muted); }
.logistics-card [data-unbind] {
  position: absolute;
  z-index: 1;
  right: 0;
  min-width: 62px;
  margin-top: 4px;
  background: #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / 16%);
}
.logistics-bind-dialog { padding: 0; }
.logistics-bind-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.logistics-bind-dialog header h2 { margin: 0; font-size: 18px; font-weight: 500; }
.logistics-bind-dialog header button { color: var(--subtle); font-size: 20px; }
.logistics-dialog-fields { display: grid; gap: 16px; padding: 24px 28px 20px; }
.logistics-dialog-fields > label {
  display: grid;
  grid-template-columns: minmax(74px, 92px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.logistics-dialog-fields > label > span { text-align: right; font-weight: 600; }
.logistics-dialog-fields > label:has([required]) > span::before { color: var(--danger); content: "* "; }
.logistics-dialog-fields .field-note { margin: 0 0 0 104px; }
.logistics-bind-dialog footer { justify-content: center; padding: 0 20px 20px; }
.logistics-bind-dialog footer .primary { min-width: 98px; }
.logistics-pagination { margin-top: 16px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.console-table { width: 100%; border-spacing: 0; text-align: left; font-size: 13px; }
.console-table th, .console-table td { min-width: 65px; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.console-table th { background: #f8f9fb; color: var(--muted); white-space: nowrap; font-weight: 600; }
.console-table td { color: var(--muted); }
.console-table tbody tr:hover td { background: #fafcfe; }
.console-table td:last-child { min-width: 106px; }
.console-table .empty, .empty { padding: 30px 12px; color: var(--subtle); text-align: center; }
.category-table { min-width: 860px; }
.category-table .category-name { min-width: 135px; }
.category-table .category-icon { font-size: 15px; }
.category-icon img { display: block; object-fit: contain; }
.category-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--brand-light);
  color: var(--brand-hover);
  font-size: 11px;
}
.category-description { display: block; margin-top: 3px; color: var(--subtle); overflow-wrap: anywhere; }
.category-timed { display: block; margin-top: 3px; color: var(--brand-hover); }
.category-table .category-child td { background: #f7f9fa; }
.category-table .category-child .category-name { padding-left: 24px; }
.category-expand,
.category-switch {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.category-expand {
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
}
.category-expand::before {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  content: "";
}
.category-expand[aria-expanded=true]::before { transform: rotate(45deg); }
.category-switch {
  gap: 6px;
  padding: 4px 0;
  white-space: nowrap;
}
.category-switch[aria-disabled=true] { cursor: wait; opacity: .65; }
.category-switch-track {
  position: relative;
  width: 34px;
  height: 17px;
  border-radius: 10px;
  background: #9ba0a8;
}
.category-switch-track::before {
  position: absolute;
  inset: 2px auto auto 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: white;
  content: "";
}
.category-switch[aria-checked=true] .category-switch-track { background: var(--brand); }
.category-switch[aria-checked=true] .category-switch-track::before { transform: translateX(17px); }
.category-channel-menu summary, .product-row-more summary { cursor: pointer; white-space: nowrap; }
.category-channel-menu > div, .product-row-more[open] {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.category-channel-menu > div > button { display: block; }
.product-list-layout { display: grid; grid-template-columns: minmax(146px, 186px) minmax(0, 1fr); gap: 16px; }
.product-category-rail {
  align-self: start;
  min-width: 0;
  padding: 10px 10px 10px 0;
  border-right: 1px solid var(--border);
}
.product-category-rail h2 { margin: 0; font-size: 15px; }
.product-category-rail .toolbar { justify-content: space-between; }
.product-category-rail input { width: 100%; }
[data-product-categories] { display: grid; align-content: start; gap: 4px; max-height: 54vh; margin-top: 8px; overflow: auto; }
[data-product-categories] .button { min-width: 0; text-align: left; justify-content: flex-start; overflow-wrap: anywhere; }
[data-product-categories] [aria-pressed=true] { background: #edf8f1; border-color: #d6eddf; color: var(--brand-hover); }
.product-list-results { min-width: 0; }
.product-row-more { display: inline-block; margin: 0 4px; color: var(--brand-hover); }
.product-sort-handle { cursor: grab; font-size: 16px; }
.product-editor-panel h2 { margin: 0; }
.product-editor-panel .page-tabs { margin: 4px 0 14px; }
.product-editor-panel [data-editor-section] { min-width: 0; margin: 0 0 16px; padding: 14px; border: 1px solid var(--border); }
.product-editor-panel [data-product-preview] { object-fit: cover; border-radius: 4px; }
@media (max-width: 780px) {
  .product-list-layout { grid-template-columns: minmax(0, 1fr); }
  .product-category-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  [data-product-categories] { max-height: 180px; }
}
.table-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(174px, 1fr)); gap: 14px; }
.table-card { padding: 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.table-card h3 { margin: 0 0 8px; font-size: 15px; }
.table-card p { margin: 6px 0; color: var(--muted); }
.desk-status-card { --desk-tone: #1c8656; --desk-tint: #edf7f1; overflow: hidden; }
.desk-status-card[data-state="已扫码未下单"] { --desk-tone: #a35d08; --desk-tint: #fff5e5; }
.desk-status-card[data-state="未结账"] { --desk-tone: #b24740; --desk-tint: #fff1ef; }
.desk-status-card[data-state="已结账"] { --desk-tone: #326b8d; --desk-tint: #edf6fb; }
.desk-status-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: -14px -14px 8px; padding: 9px 12px; color: var(--desk-tone); background: var(--desk-tint); }
.desk-status-card-header h3 { margin: 0; }
.desk-status-card-header .status-label { color: inherit; border-color: currentColor; }
.desk-card-actions { display: flex; flex-wrap: wrap; align-items: center; }
.desk-table-tabs { display: grid; gap: 10px; margin: 8px 0 14px; }
.desk-area-tabs { padding: 10px; border: 1px solid var(--border); border-radius: 4px; }
.desk-area-tabs summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; }
.desk-area-tabs summary span { color: var(--muted); }
.desk-area-options, .desk-status-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.desk-area-options { margin-top: 10px; }
.desk-area-options button { gap: 6px; }
.desk-area-options small { color: var(--muted); }
.desk-table-tabs button[aria-pressed=true] { border-color: var(--brand); color: var(--brand); background: #ecf8f1; }
.table-more { position: relative; }
.table-more > summary { cursor: pointer; list-style: none; }
.desk-add-split { display: inline-flex; align-items: stretch; }
.desk-add-split > button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.desk-add-menu { position: relative; }
.desk-add-menu summary { cursor: pointer; list-style: none; border-top-left-radius: 0; border-bottom-left-radius: 0;
  border-left-color: rgb(255 255 255 / 40%); }
.desk-batch-range { min-width: 0; border: 1px solid var(--border); }
.desk-batch-range > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.desk-batch-range input { width: 92px; }
.desk-batch-range span { max-width: 100%; overflow-wrap: anywhere; }
.table-more-menu {
  position: absolute;
  z-index: 2;
  inset: calc(100% + 4px) auto auto 0;
  min-width: max-content;
  display: grid;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 3px 10px rgb(0 0 0 / 10%);
}
.table-more-menu > .button { justify-content: flex-start; padding: 5px 10px; }
.dialog.table-code-batch { width: min(780px, calc(100vw - 28px)); }
.table-code-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.table-code-header h2, .table-code-header h3 { margin: 0; }
.table-code-header small { color: var(--muted); font-size: 12px; font-weight: normal; }
.table-code-form { display: grid; gap: 12px; margin-bottom: 20px; }
.table-code-form p { margin: 0; }
.table-code-form > label { display: flex; align-items: center; gap: 12px; }
.table-code-form fieldset { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 6px 12px; border: 1px solid var(--border); }
.table-code-form legend { padding: 0 4px; }
.table-code-pages { justify-content: flex-end; margin-top: 10px; }
.table-sort-grid .table-card { cursor: grab; }
.table-sort-grid .table-card:active { cursor: grabbing; }
.table-sort-footer {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.table-sort-footer p { margin: 0 auto 0 0; }
.table-charge-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-height: 180px;
  overflow-y: auto;
}
.status-label {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid #d3ebdd;
  border-radius: 4px;
  background: var(--brand-light);
  color: #188346;
  white-space: nowrap;
  font-size: 12px;
}
.status-label.muted { border-color: var(--border); background: #f5f6f7; color: var(--muted); }
.status-label.warning { border-color: #faecd8; background: #fdf6ec; color: #a76611; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 3px; background: #fff; }
.metric strong { display: block; margin-top: 6px; font-size: 23px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); }
.counter-summary, .counter-ledger { padding-inline: clamp(16px, 2.3vw, 40px); }
.counter-heading { justify-content: space-between; }
.counter-heading h2 { margin: 0; }
.counter-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0 22px;
  border-bottom: 1px solid var(--border);
}
.counter-metrics span { color: var(--muted); }
.counter-metrics strong { display: block; margin-top: 6px; font-size: 25px; font-variant-numeric: tabular-nums; }
.counter-amount { padding-top: 18px; margin-bottom: 0; }
.counter-amount label span, .counter-dates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
}
.counter-amount label span { overflow: hidden; gap: 0; }
.counter-amount label b { padding: 6px 16px; color: var(--muted); background: var(--canvas); }
.counter-amount label span input { border: 0; border-radius: 0; }
.dialog.counter-calendar { width: min(650px, calc(100% - 28px)); }
.counter-calendar-inputs { margin-bottom: 8px; }
.counter-calendar-navigation { justify-content: space-between; margin-bottom: 0; }
.counter-calendar-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.counter-calendar-months h3 { margin: 4px 0 8px; text-align: center; }
.counter-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.counter-calendar-days > * { display: grid; place-items: center; min-height: 32px; }
.counter-calendar-days button { min-width: 0; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.counter-calendar-days button:hover, .counter-calendar-days button:focus-visible { border-color: var(--brand); }
.counter-calendar-days [data-in-range] { background: var(--canvas); }
.counter-calendar-days [aria-pressed="true"] { color: white; background: var(--brand); }
@media (max-width: 520px) {
  .counter-calendar-months { grid-template-columns: 1fr; }
}
.counter-presets { display: flex; flex-wrap: wrap; }
.counter-table { table-layout: fixed; }
.counter-table th { background: white; }
.counter-pages { margin: 16px 0 4px; }
.counter-pages [data-page] { padding: 6px 10px; border-radius: 3px; color: white; background: var(--brand); }
.counter-pages label input[name=page] { width: 62px; }
.counter-receipt-dialog [data-external] label { display: block; margin: 8px 0; }
@media (max-width: 900px) {
  .counter-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  padding: 20px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 8px 36px rgb(0 0 0 / 18%);
  color: var(--ink);
}
.dialog::backdrop { background: rgb(0 0 0 / 36%); }
.dialog h2, .dialog h3 { margin: 0 0 18px; font-size: 17px; }
.dialog.user-detail-dialog { width: min(720px, calc(100vw - 28px)); }
.user-detail-dialog .user-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(12em, 100%), 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.user-detail-fields dt { color: var(--muted); }
.user-detail-fields dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.user-detail-dialog details { margin-top: 12px; }
.user-detail-dialog summary { cursor: pointer; }
.user-detail-dialog details .table-wrap { max-height: 35dvh; overflow: auto; }
.user-detail-dialog details .toolbar { margin-top: 8px; }
.dialog.category-editor { width: min(600px, calc(100vw - 28px)); }
.category-editor .form-grid { grid-template-columns: minmax(0, 1fr); }
.category-editor .form-grid > label, .category-editor-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--muted);
}
.category-editor :is(.form-grid > label, .category-editor-row) > span { padding-top: 6px; }
.category-tag-field { display: flex; align-items: start; gap: 10px; }
.category-tag-field > a { padding-top: 6px; white-space: nowrap; }
.category-tag-picker { min-width: 0; flex: 1; border: 1px solid var(--field-border); border-radius: 4px; }
.category-tag-picker summary { min-height: 30px; padding: 5px 10px; overflow-wrap: anywhere; }
.category-tag-picker > div { max-height: 150px; overflow: auto; padding: 5px 10px; border-top: 1px solid var(--border); }
.category-tag-picker label { display: flex; }
.category-editor :is([data-category-images], .category-schedule) fieldset,
.category-schedule {
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.category-editor [data-category-images] { display: grid; gap: 10px; }
.category-editor .category-window { margin-top: 8px; background: var(--canvas); }
.category-window .toolbar + .toolbar { margin-top: 8px; }
.category-window input[type="time"] { width: 96px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid > label { display: grid; align-content: start; gap: 6px; color: var(--muted); }
.form-grid .wide, .form-grid > fieldset { grid-column: 1 / -1; }
.form-grid fieldset { min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid var(--border); }
.form-grid legend { color: var(--muted); }
.channel-fields .checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 9px;
  white-space: nowrap;
}
.channel-fields .checkbox-field:last-child { margin-right: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.console-toast {
  position: fixed;
  z-index: 10;
  inset: 60px auto auto 50%;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 10px 17px;
  transform: translateX(-50%);
  border: 1px solid #ccead8;
  border-radius: 4px;
  background: var(--brand-light);
  color: #188346;
  box-shadow: 0 2px 10px rgb(0 0 0 / 7%);
}
.console-toast[data-type=error] { border-color: #fbe2e2; background: #fef0f0; color: #a72f2f; }

.console-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f3f7f5;
}
.login-card {
  width: min(100%, 388px);
  padding: 34px 36px 26px;
  border: 1px solid #e4ebe7;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 32px rgb(36 70 50 / 8%);
}
.login-header { margin-bottom: 24px; text-align: center; }
.login-brand { color: var(--brand-hover); font-size: 27px; font-weight: 700; letter-spacing: 2px; }
.login-header h1 { margin: 8px 0 4px; font-size: 21px; font-weight: 600; }
.login-header p { margin: 0; color: var(--muted); font-size: 13px; }
.login-field { display: grid; gap: 6px; margin-bottom: 14px; color: var(--muted); }
.login-field select, .login-field input:not([type=checkbox]) { min-height: 38px; }
.login-status { margin: 0 0 10px; color: #b92f2f; }
.login-status:empty { display: none; }
.login-submit { min-height: 38px; width: 100%; font-size: 15px; }
.login-setup { display: block; margin-top: 16px; text-align: center; font-size: 13px; }

@media (max-width: 760px) {
  .console-brand { flex-basis: 84px; padding-left: 10px; }
  .console-brand strong { font-size: 15px; }
  .console-header-actions { gap: 7px; padding-right: 10px; }
  .merchant-shortcuts { display: none; }
  .merchant-account-menu > summary { max-width: min(36vw, 160px); }
  .merchant-field > span { display: none; }
  .merchant-field select { max-width: 110px; }
  .console-sidebar { width: var(--sidebar-width); transform: translateX(-100%); visibility: hidden; }
  .nav-open .console-sidebar { transform: translateX(0); visibility: visible; box-shadow: 4px 0 18px rgb(0 0 0 / 10%); }
  .console-content { margin-left: 0; padding: 12px 10px 22px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .panel { padding: 12px; }
}
@media (max-width: 420px) {
  .login-card { padding: 24px; }
  .console-account { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

.pos-tools [data-note-label] { overflow-wrap: anywhere; max-width: 24em; }
.pos-dialog { width: min(720px, 92vw); }
.pos-print-sheet { display: none; }
@media print {
  body:has(> .pos-print-sheet) > :not(.pos-print-sheet) { display: none !important; }
  body > .pos-print-sheet { display: block !important; color: #000; background: #fff; }
  .pos-print-sheet .pos-paper { max-width: 84mm; margin: auto; }
  .pos-print-sheet .console-table { min-width: 0; }
}
