:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #fbfdfb;
  --text: #172018;
  --muted: #6f786f;
  --line: #e1e7df;
  --green: #365f2f;
  --green-dark: #233f20;
  --green-soft: #eef5ec;
  --lime: #9ddd2b;
  --warn: #b45f06;
  --shadow: 0 18px 45px rgba(23, 32, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 32px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand {
  color: var(--green);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

.login-panel h1 {
  margin: 16px 0 24px;
  font-size: 28px;
}

.store-apply-panel h1 {
  margin-bottom: 18px;
}

.login-register-button {
  width: 100%;
  margin-top: 10px;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 24, 0.45);
}

.modal-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(23, 32, 24, 0.22);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin-top: 8px;
}

.confirm-panel {
  width: min(440px, 100%);
  overflow: visible;
}

.confirm-message {
  margin-bottom: 22px;
  color: var(--text);
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions .primary {
  margin-top: 0;
}

.toast-notice {
  position: fixed;
  right: 28px;
  top: 28px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid #cfe1c9;
  border-radius: 8px;
  background: #f6fbf4;
  color: var(--green-dark);
  box-shadow: var(--shadow);
  font-weight: 700;
  line-height: 1.5;
}

.toast-notice.error {
  border-color: #f1c5b9;
  background: #fff8f5;
  color: #9b3f1c;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
}

input,
select,
textarea {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(54, 95, 47, 0.1);
}

textarea {
  height: auto;
  min-height: 104px;
  padding: 10px 12px;
  resize: vertical;
}

.primary,
.secondary {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.primary {
  width: 100%;
  margin-top: 8px;
  background: var(--green);
  color: #ffffff;
}

.secondary {
  background: var(--green-soft);
  color: var(--green);
}

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

.secondary:hover,
.mini:hover,
.tab-button:hover {
  border-color: #bdd4b7;
  background: #e3efdf;
}

.hint,
.muted {
  color: var(--muted);
}

.hint {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
}

.admin-icp-footer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-icp-footer a {
  color: var(--green);
  text-decoration: none;
}

.admin-icp-footer a:hover {
  text-decoration: underline;
}

.admin-icp-footer a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.login-icp-footer {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.login-icp-footer::before {
  content: "";
  width: min(226px, 70vw);
  border-top: 1px solid #d5ded4;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  padding: 24px 16px;
  background: #172018;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.logo {
  margin-bottom: 28px;
  font-size: 22px;
  font-weight: 900;
}

.nav {
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  padding: 0 14px;
  white-space: nowrap;
}

.nav.active {
  background: var(--lime);
  color: #142011;
  font-weight: 800;
}

.logout {
  width: 100%;
  margin-top: auto;
}

.workspace {
  margin-left: 232px;
  padding: 28px;
  min-width: 0;
}

.purchase-limit-panel .panel-head > .actions {
  align-items: center;
  flex-wrap: wrap;
}

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

.purchase-limit-summary-grid > span {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 6px;
}

.purchase-limit-modal {
  width: min(860px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
}

.purchase-limit-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.purchase-limit-weekdays label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

@media (max-width: 760px) {
  .purchase-limit-summary-grid,
  .purchase-limit-release-grid {
    grid-template-columns: 1fr;
  }
}

.admin-shell {
  display: grid;
  grid-template-columns: 72px 220px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.admin-shell .workspace {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 28px 28px;
}

.workspace-icp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.module-rail {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 16px 8px;
  background: #172018;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.rail-brand {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: #142011;
  font-size: 20px;
  font-weight: 900;
}

.rail-groups {
  display: grid;
  gap: 6px;
}

.module-rail,
.module-menu-list {
  scrollbar-width: none;
}

.module-rail::-webkit-scrollbar,
.module-menu-list::-webkit-scrollbar {
  display: none;
}

.module-group-button,
.rail-logout {
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.module-group-button.active,
.module-group-button:hover,
.rail-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.module-group-button.active {
  box-shadow: inset 3px 0 0 var(--lime);
  font-weight: 800;
}

.rail-logout {
  margin-top: auto;
}

.module-menu {
  position: sticky;
  top: 0;
  z-index: 19;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.module-brand {
  min-height: 42px;
  font-size: 18px;
  font-weight: 900;
  color: var(--green-dark);
}

.module-menu-heading {
  margin: 18px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.module-menu-heading span,
.context-bar label > span,
.context-account > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.module-menu-heading strong {
  font-size: 17px;
}

.module-menu-list {
  display: grid;
  gap: 6px;
}

.module-menu-button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4f5d50;
  text-align: left;
  font-size: 14px;
}

.module-menu-button.active,
.module-menu-button:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.module-menu-button.active {
  font-weight: 800;
}

.module-account {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.context-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1.2fr) minmax(142px, 0.8fr) minmax(120px, 0.7fr) minmax(120px, 0.8fr);
  gap: 10px;
  align-items: end;
  margin: 0 -28px 24px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.96);
  box-shadow: 0 4px 16px rgba(23, 32, 24, 0.05);
}

.context-bar label {
  min-width: 0;
}

.context-bar select,
.context-bar input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

.context-account {
  min-height: 38px;
  padding: 4px 10px;
  border-left: 1px solid var(--line);
}

.context-account strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.feature-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.feature-settings-head strong,
.feature-settings-head span {
  display: block;
}

.feature-settings-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.feature-template-actions button {
  min-height: 40px;
}

.feature-switch-grid {
  display: grid;
  gap: 20px;
}

.feature-group-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-group-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.feature-group-section h2 {
  font-size: 18px;
}

.feature-group-section header span {
  color: var(--muted);
  font-size: 13px;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 86px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

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

.feature-row-copy strong,
.feature-row-copy span,
.feature-row-copy small {
  display: block;
}

.feature-row-copy strong {
  font-size: 15px;
}

.feature-row-copy span,
.feature-row-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.feature-row-state {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-inherited-source {
  min-width: 72px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.feature-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
  cursor: pointer;
}

.feature-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feature-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #cfd7cf;
  transition: background 160ms ease;
}

.feature-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 32, 17, 0.2);
  transition: transform 160ms ease;
}

.feature-toggle input:checked + .feature-toggle-track {
  background: var(--green);
}

.feature-toggle input:checked + .feature-toggle-track::after {
  transform: translateX(18px);
}

.feature-toggle input:disabled + .feature-toggle-track {
  opacity: 0.5;
}

.feature-toggle-text {
  min-width: 28px;
  font-size: 13px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 28px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card {
  padding: 20px;
  min-height: 112px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.panel {
  padding: 20px;
  box-shadow: 0 8px 24px rgba(23, 32, 24, 0.04);
}

.section-gap {
  margin-top: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.panel-head h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.workbench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.workbench-card {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.workbench-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.workbench-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
}

.workbench-card.active {
  border-color: var(--green);
  background: #eef5ec;
}

.workbench-card.active span,
.workbench-card.active strong {
  color: var(--green);
}

.ops-summary,
.metric-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.ops-summary {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  padding: 14px;
  border: 1px solid #d9e7d5;
  border-radius: 8px;
  background: #f6fbf4;
}

.ops-summary strong,
.ops-summary span {
  display: block;
}

.ops-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ops-item {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 17px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ops-item strong {
  color: var(--text);
  font-size: 16px;
}

.ops-item.warning {
  background: #fff8ef;
  color: var(--warn);
}

.ops-item.danger {
  background: #fff3ee;
  color: #a74415;
}

.ops-item.muted strong {
  color: var(--muted);
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.metric-item {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.metric-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-item strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 24px;
}

.metric-item.warning {
  border-color: #efd2b8;
  background: #fff8ef;
}

.metric-item.warning strong {
  color: var(--warn);
}

.metric-item.danger {
  border-color: #f1c7b7;
  background: #fff3ee;
}

.metric-item.danger strong {
  color: #a74415;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.dashboard-grid .metric-strip {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.status-list.compact {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  margin-top: 12px;
}

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

.dashboard-action {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.dashboard-action strong,
.dashboard-action span {
  display: block;
}

.dashboard-action strong {
  color: var(--green);
  font-size: 15px;
}

.dashboard-action span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settlement-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.settlement-guide-card {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.settlement-guide-card strong,
.settlement-guide-card span {
  display: block;
}

.settlement-guide-card strong {
  color: var(--green);
  font-size: 16px;
}

.settlement-guide-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-action:hover {
  border-color: #bdd4b7;
  background: #f6fbf4;
}

.release-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #d9e7d5;
  border-radius: 8px;
  background: #f6fbf4;
}

.release-hero strong,
.release-hero span,
.release-score strong,
.release-score span {
  display: block;
}

.release-hero > div:first-child strong {
  color: var(--green);
  font-size: 20px;
}

.release-hero > div:first-child span {
  margin-top: 6px;
  color: var(--muted);
}

.release-score {
  min-width: 128px;
  text-align: right;
}

.release-score strong {
  color: var(--green);
  font-size: 28px;
}

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

.release-summary {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.release-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.release-section-card {
  align-self: start;
}

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

.release-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.release-check.ok {
  border-color: #cfe0ca;
  background: #f6fbf4;
}

.release-check.warn {
  border-color: #efd2b8;
  background: #fffaf2;
}

.release-check.danger {
  border-color: #f1c7b7;
  background: #fff6f1;
}

.release-check-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.release-check-main p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.release-badge {
  display: inline-flex;
  height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.release-badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.release-badge.warn {
  background: #fff2df;
  color: var(--warn);
}

.release-badge.danger {
  background: #ffe7df;
  color: #a74415;
}

.release-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(23, 32, 24, 0.08);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.release-action span {
  min-width: 0;
}

.release-jump {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.delivery-batch-panel {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d9e7d5;
  border-radius: 8px;
  background: var(--panel-soft);
}

.delivery-view.section-tasks .delivery-batch-panel {
  display: none;
}

.delivery-view.section-batches .delivery-table-wrap,
.delivery-view.section-batches .delivery-pagination-bar {
  display: none;
}

.delivery-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.delivery-batch-card,
.empty-card {
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.delivery-batch-card.warning {
  border-color: #efd2b8;
  background: #fffaf2;
}

.delivery-batch-card.danger {
  border-color: #f1c7b7;
  background: #fff6f1;
}

.batch-card-head,
.batch-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.batch-card-head strong,
.batch-card-head span {
  display: block;
}

.batch-card-head strong {
  font-weight: 800;
}

.batch-card-head span,
.batch-card-foot {
  color: var(--muted);
  font-size: 12px;
}

.batch-meal {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.batch-card-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
}

.batch-card-metrics span {
  min-height: 44px;
  padding: 6px;
  border-radius: 6px;
  background: #f7faf6;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.batch-card-metrics strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.batch-card-metrics .danger strong {
  color: #a74415;
}

.batch-card-foot span:first-child {
  color: var(--green);
  font-weight: 800;
}

.batch-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.batch-card-actions .muted {
  min-width: 0;
  font-size: 12px;
}

.empty-card {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.view-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding: 8px 0;
  background: var(--bg);
}

.report-tabs {
  top: 8px;
}

.print-tabs {
  top: 8px;
}

.notification-tabs {
  top: 8px;
}

.security-tabs {
  top: 8px;
}

.rules-tabs {
  top: 8px;
}

.delivery-tabs {
  top: 8px;
}

.staff-tabs {
  top: 8px;
}

.org-tabs {
  top: 8px;
}

.payment-tabs {
  top: 8px;
}

.report-section-panel.hidden {
  display: none;
}

.report-global-filters.hidden {
  display: none;
}

.print-section-panel.hidden {
  display: none;
}

.notification-section-panel.hidden {
  display: none;
}

.security-section-panel.hidden {
  display: none;
}

.primary-admin-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #eef7f3;
}

.primary-admin-setup div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.primary-admin-setup span {
  color: var(--muted);
  font-size: 13px;
}

.primary-admin-setup button {
  flex: none;
}

.settlement-settings {
  padding: 18px 22px 24px;
}

.settlement-hospital-picker {
  display: grid;
  gap: 6px;
  max-width: 420px;
  margin-bottom: 18px;
}

.settlement-options-list {
  border-top: 1px solid var(--line);
}

.settlement-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.settlement-option-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settlement-option-row small {
  color: var(--muted);
  font-size: 12px;
}

.settlement-option-row input {
  flex: none;
  width: 18px;
  height: 18px;
}

@media (max-width: 700px) {
  .primary-admin-setup {
    align-items: stretch;
    flex-direction: column;
  }
}

.staff-section-panel.hidden {
  display: none;
}

.payment-section-panel.hidden {
  display: none;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.tab-button span {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: #eef5ec;
  color: var(--green);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.tab-button.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.tab-button.active span {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sticky-filters {
  position: sticky;
  top: 54px;
  z-index: 4;
  padding: 10px 0;
  background: var(--panel);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap table {
  min-width: 980px;
}

.order-table-wrap table {
  min-width: 1180px;
}

.delivery-table-wrap table,
.report-order-table-wrap table,
.staff-credit-table-wrap table {
  min-width: 1160px;
}

.report-product-table-wrap table {
  min-width: 980px;
}

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

.staff-bill-filters label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.staff-bill-filters input,
.staff-bill-filters select {
  width: 100%;
  min-width: 0;
}

.staff-bill-search {
  align-self: end;
  height: 42px;
}

.staff-bill-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.staff-bill-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--line);
}

.staff-bill-summary > div:first-child {
  padding-left: 0;
}

.staff-bill-summary > div:last-child {
  border-right: 0;
}

.staff-bill-summary span,
.staff-bill-note {
  color: var(--muted);
  font-size: 13px;
}

.staff-bill-summary strong {
  font-size: 20px;
}

.staff-bill-note {
  margin-bottom: 12px;
}

.staff-bill-table-wrap table {
  min-width: 1260px;
}

.staff-bill-products {
  min-width: 230px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .staff-bill-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .staff-bill-summary > div {
    padding: 8px 12px;
  }

  .staff-bill-summary > div:nth-child(2) {
    border-right: 0;
  }

  .staff-bill-summary > div:nth-child(4) {
    border-right: 0;
  }

  .staff-bill-summary > div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .staff-bill-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-bill-filters label:nth-child(7),
  .staff-bill-search {
    grid-column: 1 / -1;
  }

  .staff-bill-summary strong {
    font-size: 17px;
  }
}

.print-config-table-wrap table,
.account-table-wrap table {
  min-width: 1100px;
}

.print-record-table-wrap table,
.log-table-wrap table {
  min-width: 920px;
}

.notification-table-wrap table {
  min-width: 1180px;
}

.notification-channel-table-wrap table {
  min-width: 1220px;
}

.role-table-wrap table {
  min-width: 1040px;
}

.role-editor-head,
.role-editor-title,
.role-editor-tools,
.role-editor-group-head,
.role-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.role-editor-head { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.role-editor-head h2 { font-size: 18px; }
.role-editor-head .muted { font-size: 13px; }
.role-editor-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 620px; }
.role-editor-sidebar { padding: 12px; border-right: 1px solid var(--line); background: #f8faf8; }
.role-editor-item {
  width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); text-align: left;
}
.role-editor-item.active { border-color: #a9c9a5; background: #eaf3e9; }
.role-editor-item:not(.active):hover { background: #edf2ec; }
.role-editor-item span { display: grid; min-width: 0; }
.role-editor-item strong { font-size: 14px; overflow-wrap: anywhere; }
.role-editor-item small { font-size: 12px; color: var(--muted); }
.role-editor-item b { font-size: 12px; color: var(--green); }
.role-editor-main { display: flex; flex-direction: column; min-width: 0; }
.role-editor-title { align-items: flex-start; padding: 20px 24px 16px; }
.role-editor-title h3 { margin: 0 0 3px; font-size: 18px; }
.role-editor-title label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.role-editor-title input { max-width: 270px; }
.role-editor-title > div:first-child { display: flex; flex-wrap: wrap; gap: 12px; }
.role-editor-title > div:first-child h3 { width: 100%; }
.role-editor-title > div:first-child .muted { width: 100%; font-size: 13px; }
.role-editor-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.role-editor-meta span { padding: 3px 8px; background: #f1f4f0; border-radius: 4px; }
.role-editor-draft-fields { display: flex; gap: 12px; padding: 0 24px 16px; }
.role-editor-draft-fields label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.role-editor-draft-fields input { min-width: 250px; }
.role-editor-tools { justify-content: flex-start; padding: 12px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfb; }
.role-editor-tools input[type="search"] { width: min(260px, 100%); }
.role-editor-filter { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; font-size: 13px; color: var(--text); }
.role-editor-filter input[type="checkbox"],
.role-editor-option input[type="checkbox"],
.account-access-roles input[type="checkbox"] {
  flex: none; width: 16px; height: 16px; margin: 0; padding: 0; border-radius: 3px; accent-color: var(--green);
}
.role-editor-tools strong { margin-left: auto; font-size: 13px; color: var(--green); white-space: nowrap; }
.role-editor-groups { flex: 1; padding: 12px 24px 24px; }
.role-editor-group { padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.role-editor-group h4 { margin: 0; font-size: 14px; }
.role-editor-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.role-editor-option { display: flex; align-items: flex-start; gap: 8px; min-height: 56px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.role-editor-option[hidden], .role-editor-group[hidden] { display: none; }
.role-editor-option:has(input:checked) { border-color: #b7d5b1; background: #f4faf2; }
.role-editor-option input[type="checkbox"] { margin-top: 2px; }
.role-editor-option span { display: grid; min-width: 0; }
.role-editor-option strong { font-size: 13px; font-weight: 600; }
.role-editor-option small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.role-editor-option em { margin-left: auto; color: #9d5c18; font-size: 11px; font-style: normal; white-space: nowrap; }
.role-editor-actions { position: sticky; bottom: 0; padding: 14px 24px; border-top: 1px solid var(--line); background: #fff; }
.role-editor-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.account-access-modal { width: min(900px, 100%); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.account-access-head, .account-access-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.account-access-head { border-bottom: 1px solid var(--line); }
.account-access-head h3 { margin: 0; font-size: 18px; }
.account-access-head .muted, .account-access-actions .muted { font-size: 12px; }
.account-access-body { flex: 1; overflow-y: auto; min-height: 0; padding: 18px 22px; }
.account-access-body section + section { margin-top: 22px; }
.account-access-body h4 { margin: 0 0 12px; font-size: 14px; }
.account-access-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.account-access-roles label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.account-access-roles label:has(input:checked) { border-color: #b7d5b1; background: #f4faf2; }
.account-access-roles small { color: var(--muted); }
.account-access-subhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.account-access-subhead .muted { font-size: 12px; }
.account-access-permissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.account-access-permission { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.account-access-permission span { display: grid; min-width: 0; }
.account-access-permission strong { font-size: 13px; }
.account-access-permission small { font-size: 11px; color: var(--muted); }
.account-access-permission select { flex: 0 0 106px; max-width: 106px; font-size: 12px; }
.account-access-actions { border-top: 1px solid var(--line); background: #fff; }
.account-access-reason { display: grid; gap: 5px; margin-top: 18px; font-size: 13px; }
.account-access-reason input { width: 100%; }
@media (max-width: 700px) {
  .account-access-permissions { grid-template-columns: 1fr; }
  .account-access-head, .account-access-actions { padding: 14px 16px; }
  .account-access-body { padding: 14px 16px; }
  .account-access-actions { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 820px) {
  .role-editor-layout { grid-template-columns: 1fr; }
  .role-editor-sidebar { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .role-editor-item { flex: 0 0 170px; }
  .role-editor-head, .role-editor-title, .role-editor-tools, .role-editor-actions { padding-left: 16px; padding-right: 16px; }
  .role-editor-groups { padding-left: 16px; padding-right: 16px; }
  .role-editor-title, .role-editor-actions { align-items: flex-start; flex-direction: column; }
  .role-editor-draft-fields { flex-wrap: wrap; padding-left: 16px; padding-right: 16px; }
  .role-editor-tools { flex-wrap: wrap; }
  .role-editor-tools strong { margin-left: 0; }
  .role-editor-options { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

.staff-whitelist-table-wrap table,
.staff-qr-table-wrap table {
  min-width: 1160px;
}

.staff-application-table-wrap table {
  min-width: 1040px;
}

.account-form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.account-form-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-form-head {
  margin-bottom: 14px;
}

.account-form h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

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

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid label {
  margin-bottom: 0;
}

.product-image-uploader {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.product-image-preview {
  width: 120px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cbd8c8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
}

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

.product-image-actions {
  display: grid;
  gap: 8px;
}

.product-image-actions .actions > .upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: 28px;
  gap: 0;
}

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

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.product-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.staff-qr-preview {
  display: inline-grid;
  width: 118px;
  justify-items: center;
  gap: 5px;
  color: var(--green);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.staff-qr-preview img {
  width: 108px;
  height: 108px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  image-rendering: pixelated;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.rule-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.rule-form.section-basic .rule-section-grid,
.rule-form.section-cancel > .form-grid,
.rule-form.section-delivery > .form-grid,
.rule-form.section-automation > .form-grid {
  display: none;
}

.rule-form.section-cancel .rule-section,
.rule-form.section-delivery .rule-section,
.rule-form.section-automation .rule-section {
  display: none;
}

.rule-form.section-cancel .rule-section:nth-child(1),
.rule-form.section-delivery .rule-section:nth-child(2),
.rule-form.section-automation .rule-section:nth-child(3),
.rule-form.section-automation .rule-section:nth-child(4) {
  display: grid;
}

.rule-form.section-cancel .rule-section-grid,
.rule-form.section-delivery .rule-section-grid {
  grid-template-columns: minmax(0, 1fr);
}

.rule-form.section-automation .rule-section-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.rule-section {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.rule-section h3 {
  margin: 0;
  font-size: 16px;
}

.switch-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.switch-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.switch-row span {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.switch-row strong {
  font-size: 14px;
}

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

.missing-thumb {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd8c8;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.form-primary {
  width: auto;
  min-width: 120px;
}

.schedule-week-section {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.schedule-week-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.schedule-week-toolbar > div:last-child {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 0;
}

.schedule-week-toolbar span,
.schedule-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-week-shell {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  scrollbar-width: thin;
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: 88px repeat(7, minmax(126px, 1fr));
  min-width: 980px;
}

.schedule-week-corner,
.schedule-week-day,
.schedule-week-meal {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7faf6;
  text-align: center;
}

.schedule-week-day {
  gap: 2px;
}

.schedule-week-day strong {
  font-size: 14px;
}

.schedule-week-day span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-week-day.today {
  background: #eaf4e7;
  color: var(--green);
}

.schedule-week-meal {
  min-height: 104px;
  color: var(--ink);
  font-weight: 800;
}

.schedule-week-cell {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  min-width: 0;
  min-height: 104px;
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.schedule-week-cell:hover {
  background: #f4f8f2;
}

.schedule-week-cell.active {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px var(--green);
  background: #edf6e9;
}

.schedule-week-cell.partial {
  background: #fff9ea;
}

.schedule-week-cell.unpublished {
  background: #fff5ef;
}

.schedule-week-cell.empty {
  background: #fafbfa;
  color: var(--muted);
}

.schedule-week-cell strong {
  font-size: 14px;
}

.schedule-week-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.schedule-week-status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  background: #e9f3e6;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.schedule-week-cell.partial .schedule-week-status {
  background: #fff0c7;
  color: #8a5b00;
}

.schedule-week-cell.unpublished .schedule-week-status {
  background: #ffe7d7;
  color: #a84912;
}

.schedule-week-cell.empty .schedule-week-status {
  background: #eef1ee;
  color: var(--muted);
}

.schedule-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.schedule-detail-head > div {
  display: grid;
  gap: 3px;
}

.schedule-template-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-template-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.schedule-template-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-template-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-template-actions select {
  width: min(260px, 100%);
}

.manual-schedule-modal {
  width: min(940px, 100%);
  max-height: min(84vh, 820px);
  overflow: hidden;
  padding: 22px 22px 0;
}

.manual-schedule-modal .modal-head {
  margin-bottom: 14px;
}

.manual-schedule-modal .modal-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.35;
}

.manual-schedule-context {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr 1.4fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.manual-schedule-context label,
.manual-schedule-wave {
  display: grid;
  grid-template-rows: 18px 44px;
  min-width: 0;
  gap: 6px;
  align-content: start;
}

.manual-schedule-context label > span,
.manual-schedule-wave > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.manual-schedule-context input,
.manual-schedule-context select {
  width: 100%;
  height: 44px;
  min-width: 0;
  margin: 0;
}

.manual-schedule-wave strong {
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0 11px;
  border: 1px dashed #cbd9c7;
  border-radius: 6px;
  color: var(--green-dark);
  font-size: 13px;
  line-height: 1.4;
}

.manual-schedule-modal > .notice {
  margin: 10px 0 0;
}

.manual-schedule-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.8fr);
  min-height: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.manual-schedule-products,
.manual-schedule-selection {
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.manual-schedule-products {
  padding: 14px;
}

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

.manual-schedule-search input {
  min-width: 0;
  width: 100%;
}

.manual-schedule-search button {
  min-width: 72px;
}

.manual-schedule-categories {
  display: flex;
  gap: 7px;
  margin: 10px 0;
  padding-bottom: 2px;
  overflow-x: auto;
}

.manual-schedule-categories .chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.manual-schedule-categories .chip.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.manual-schedule-product-list,
.manual-schedule-selected-list {
  max-height: 370px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.manual-schedule-product {
  display: grid;
  grid-template-columns: 22px 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

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

.manual-schedule-product:hover {
  background: var(--panel-soft);
}

.manual-schedule-product.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.manual-schedule-product input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.manual-schedule-product-image,
.manual-schedule-product-image .product-thumb,
.manual-schedule-product-image .missing-thumb {
  width: 50px;
  height: 50px;
}

.manual-schedule-product-image .product-thumb,
.manual-schedule-product-image .missing-thumb {
  border-radius: 6px;
}

.manual-schedule-product-copy,
.manual-schedule-product-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.manual-schedule-product-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-schedule-product-copy strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.manual-schedule-product-copy > span,
.manual-schedule-product-meta > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-schedule-product-meta {
  min-width: 90px;
  justify-items: end;
}

.manual-schedule-product-meta strong {
  color: var(--green-dark);
  font-size: 14px;
}

.manual-schedule-product-meta em {
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.manual-schedule-product-meta em.blocked {
  color: var(--warn);
}

.manual-schedule-selection {
  border-left: 1px solid var(--line);
  background: #fbfcfa;
}

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

.manual-schedule-selection-head > div {
  display: grid;
  gap: 2px;
}

.manual-schedule-selection-head span {
  color: var(--muted);
  font-size: 12px;
}

.manual-schedule-selection-head b {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
}

.manual-schedule-selected-list {
  padding: 0 14px;
}

.manual-schedule-selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px auto;
  align-items: end;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.manual-schedule-selected-item > div,
.manual-schedule-selected-item label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.manual-schedule-selected-item > div strong,
.manual-schedule-selected-item > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-schedule-selected-item > div strong {
  font-size: 13px;
}

.manual-schedule-selected-item > div span,
.manual-schedule-selected-item label span {
  color: var(--muted);
  font-size: 11px;
}

.manual-schedule-selected-item input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
}

.manual-schedule-selected-item .mini {
  min-height: 34px;
}

.manual-schedule-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  margin: 0 -22px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -10px 24px rgba(23, 32, 24, 0.06);
}

.manual-schedule-footer > span {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.manual-schedule-footer > span strong {
  color: var(--green-dark);
  font-size: 18px;
}

.manual-schedule-footer .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.manual-schedule-footer button {
  height: 40px;
  min-height: 40px;
  margin: 0;
  white-space: nowrap;
}

.location-panel {
  overflow: hidden;
}

.location-toolbar-actions {
  justify-content: flex-end;
}

.location-scope-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
}

.location-scope-row label {
  width: min(360px, 100%);
  margin: 0;
}

.location-summary-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.location-summary-strip span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
}

.location-summary-strip strong {
  color: var(--text);
}

.location-mobile-tabs {
  display: none;
}

.location-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.location-tree-pane,
.location-detail-pane {
  min-width: 0;
}

.location-tree-pane {
  border-right: 1px solid var(--line);
  background: #f8faf7;
}

.location-detail-pane {
  padding: 22px;
  overflow: hidden;
}

.location-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.location-pane-head > div {
  display: grid;
  gap: 2px;
}

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

.location-tree-list {
  max-height: 650px;
  padding: 8px;
  overflow: auto;
}

.location-tree-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  padding: 4px 8px 4px calc(8px + var(--location-depth, 0) * 14px);
  border-left: 3px solid transparent;
  border-radius: 6px;
}

.location-tree-row:hover {
  background: #eef4ec;
}

.location-tree-row.selected {
  border-left-color: var(--green);
  background: #e7f1e4;
}

.location-tree-row.disabled {
  opacity: 0.62;
}

.location-tree-toggle,
.location-tree-main {
  border: 0;
  background: transparent;
  color: inherit;
}

.location-tree-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: var(--green);
  font-size: 18px;
}

.location-tree-toggle.placeholder {
  display: block;
}

.location-tree-main {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 4px 6px;
  text-align: left;
}

.location-tree-name,
.location-tree-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-tree-name {
  font-weight: 700;
}

.location-tree-meta,
.location-tree-count {
  color: var(--muted);
  font-size: 12px;
}

.location-detail-empty {
  display: grid;
  max-width: 440px;
  min-height: 360px;
  margin: auto;
  place-content: center;
  justify-items: start;
  gap: 12px;
  color: var(--muted);
}

.location-detail-empty strong {
  color: var(--text);
  font-size: 22px;
}

.location-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.location-detail-head h3 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.location-breadcrumb {
  color: var(--muted);
  font-size: 13px;
}

.location-detail-tags,
.location-detail-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge.neutral {
  background: #f0f3ef;
  color: var(--muted);
}

.location-detail-grid,
.location-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.location-detail-grid > div,
.location-impact-grid > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.location-detail-grid span,
.location-impact-grid span {
  color: var(--muted);
  font-size: 13px;
}

.location-detail-grid strong {
  overflow-wrap: anywhere;
}

.location-qr-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #cfe1c9;
  border-radius: 8px;
  background: #f7fbf5;
}

.location-qr-preview {
  display: grid;
  width: 180px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  color: var(--muted);
}

.location-qr-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.location-qr-info {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 7px;
}

.location-qr-info > span,
.location-qr-info p {
  color: var(--muted);
}

.location-qr-info h4 {
  margin: 0;
  font-size: 20px;
}

.location-qr-info code {
  max-width: 100%;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 5px;
  background: #eaf2e7;
  white-space: nowrap;
}

.location-child-section {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.location-child-list {
  display: grid;
}

.location-child-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.location-child-list button:last-child {
  border-bottom: 0;
}

.location-child-list button:hover {
  background: var(--panel-soft);
}

.location-child-list button > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.location-child-list small,
.location-child-list button > span:last-child {
  color: var(--muted);
}

.location-node-modal,
.location-import-modal {
  width: min(820px, 100%);
}

.location-form-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.location-form-section-head span,
.location-terminal-toggle .checkbox-line {
  color: var(--muted);
  font-size: 13px;
}

.location-terminal-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.location-terminal-toggle .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.location-terminal-fields.is-hidden {
  display: none;
}

.location-impact-modal {
  width: min(600px, 100%);
}

.location-impact-target {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

.location-impact-target span {
  color: var(--muted);
  font-size: 13px;
}

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

.location-impact-grid .warning,
.location-import-summary .warning {
  color: var(--warn);
}

.danger-button {
  background: #a74624;
}

.location-import-picker {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed #b9c8b4;
  border-radius: 8px;
  background: var(--panel-soft);
}

.location-import-picker input {
  width: 100%;
  height: auto;
}

.location-import-picker > div {
  display: grid;
  gap: 3px;
}

.location-import-picker span {
  color: var(--muted);
  font-size: 13px;
}

.location-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 16px 0 10px;
  color: var(--muted);
}

.location-import-summary strong {
  color: var(--text);
}

.location-import-preview {
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.location-import-preview tr.invalid td {
  background: #fff6f2;
  color: #9b3f1c;
}

@media (max-width: 760px) {
  .schedule-week-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-week-toolbar > div:last-child {
    justify-items: start;
  }

  .schedule-template-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-template-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .schedule-template-actions select {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Operating analytics */
.dashboard-analytics {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.dashboard-analytics :where(h2, h3, p, span, strong, small, button) {
  overflow-wrap: anywhere;
}

.dashboard-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-page-head h2 {
  font-size: 26px;
  line-height: 1.25;
}

.dashboard-page-head p,
.dashboard-page-head > span,
.dashboard-section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-page-head p {
  margin-top: 4px;
}

.dashboard-filter-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) auto minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dashboard-scope-fields,
.dashboard-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.dashboard-filter-bar label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dashboard-filter-bar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-filter-bar select,
.dashboard-filter-bar input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d7dfd5;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.dashboard-date-presets,
.dashboard-filter-actions {
  display: flex;
  gap: 6px;
}

.dashboard-date-presets button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d7dfd5;
  border-radius: 6px;
  background: #fff;
  color: #5f695f;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-date-presets button:hover,
.dashboard-date-presets button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.dashboard-filter-actions button {
  min-width: 72px;
  height: 38px;
}

.dashboard-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-left: 3px solid #c24137;
  background: #fff3f1;
  color: #8d2f28;
  font-size: 13px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dashboard-kpi {
  min-width: 0;
  padding: 17px 16px;
  border-right: 1px solid var(--line);
}

.dashboard-kpi:last-child {
  border-right: 0;
}

.dashboard-kpi-label,
.dashboard-kpi strong,
.dashboard-change {
  display: block;
}

.dashboard-kpi-label {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-kpi > strong {
  overflow: hidden;
  margin-top: 7px;
  color: #172018;
  font-size: 23px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi.refund > strong {
  color: #a43d33;
}

.dashboard-change {
  margin-top: 7px;
  color: #7a837a;
  font-size: 11px;
  white-space: nowrap;
}

.dashboard-change.up {
  color: var(--green);
}

.dashboard-change.down {
  color: #a43d33;
}

.dashboard-exception-band,
.dashboard-analysis-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.dashboard-section-heading h3 {
  margin: 0 0 2px;
  font-size: 17px;
  line-height: 1.35;
}

.dashboard-exception-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.dashboard-exception {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid #e3e8e1;
  border-radius: 6px;
  background: #f8faf7;
  color: var(--text);
  text-align: left;
}

.dashboard-exception:hover:not(:disabled) {
  border-color: #9db697;
  background: var(--green-soft);
}

.dashboard-exception.warning {
  border-color: #efd2aa;
  background: #fff8ef;
}

.dashboard-exception span,
.dashboard-exception small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-exception strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--green-dark);
  font-size: 22px;
}

.dashboard-exception.warning strong {
  color: var(--warn);
}

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

.dashboard-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
  gap: 16px;
}

.dashboard-lower-grid {
  grid-template-columns: minmax(290px, 0.75fr) minmax(0, 1.75fr);
}

.dashboard-trend-chart {
  width: 100%;
  height: 260px;
  overflow: hidden;
}

.dashboard-trend-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dashboard-trend-point rect {
  fill: #dbead7;
}

.dashboard-trend-point text {
  fill: #768076;
  font-size: 10px;
}

.dashboard-chart-axis,
.dashboard-chart-grid {
  stroke: #dfe5dd;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-grid {
  stroke-dasharray: 4 5;
}

.dashboard-order-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.dashboard-order-points circle {
  fill: #fff;
  stroke: var(--green);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dashboard-chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-chart-legend i {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: #dbead7;
}

.dashboard-chart-legend i:nth-of-type(2) {
  height: 2px;
  background: var(--green);
}

.dashboard-meal-list,
.dashboard-settlement-list,
.dashboard-product-list {
  display: grid;
  gap: 0;
}

.dashboard-meal-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) repeat(4, auto);
  gap: 12px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid #edf0ec;
  font-size: 13px;
}

.dashboard-meal-row:last-child {
  border-bottom: 0;
}

.dashboard-meal-row span {
  color: var(--muted);
  white-space: nowrap;
}

.dashboard-settlement-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(100px, 1.2fr) 46px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid #edf0ec;
}

.dashboard-settlement-row:last-child {
  border-bottom: 0;
}

.dashboard-settlement-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

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

.dashboard-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #eef1ed;
}

.dashboard-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.dashboard-settlement-row.refund .dashboard-progress i {
  background: #c35b4f;
}

.dashboard-product-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.dashboard-product-block {
  min-width: 0;
}

.dashboard-product-list button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid #edf0ec;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.dashboard-product-list button:hover {
  background: #f6faf5;
}

.dashboard-product-list button > b {
  color: var(--green);
  text-align: center;
}

.dashboard-product-list button > span,
.dashboard-product-list button strong,
.dashboard-product-list button small {
  display: block;
  min-width: 0;
}

.dashboard-product-list button strong,
.dashboard-product-list button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-product-list button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-product-number {
  max-width: 150px;
  text-align: right;
}

.dashboard-compact-empty,
.dashboard-initial-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.dashboard-initial-state {
  gap: 7px;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dashboard-initial-state strong {
  color: var(--text);
  font-size: 17px;
}

.dashboard-refreshing {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 9px 13px;
  border: 1px solid #cbdac7;
  border-radius: 6px;
  background: #f4faf2;
  color: var(--green-dark);
  box-shadow: 0 8px 22px rgba(35, 63, 32, 0.12);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .dashboard-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .dashboard-kpi:nth-child(3n) {
    border-right: 0;
  }

  .dashboard-kpi:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 1000px) {
  .dashboard-filter-bar {
    grid-template-columns: 1fr;
  }

  .dashboard-scope-fields,
  .dashboard-date-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-date-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-filter-actions {
    justify-content: flex-end;
  }

  .dashboard-analysis-grid,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 760px) {
  .dashboard-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-filter-bar,
  .dashboard-scope-fields,
  .dashboard-date-fields,
  .dashboard-product-columns {
    grid-template-columns: 1fr;
  }

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

  .dashboard-date-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-date-presets button {
    min-width: 0;
    padding: 0 5px;
  }

  .dashboard-filter-actions button {
    flex: 1;
  }

  .dashboard-kpi {
    display: block;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .dashboard-kpi:nth-child(2n) {
    border-right: 0;
  }

  .dashboard-kpi:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .dashboard-kpi > strong {
    margin-top: 6px;
    font-size: 21px;
  }

  .dashboard-change {
    margin-top: 3px;
  }

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

  .dashboard-exception:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-analysis-panel,
  .dashboard-exception-band {
    padding: 15px;
  }

  .dashboard-trend-chart {
    height: 220px;
  }

  .dashboard-meal-row {
    grid-template-columns: minmax(70px, 1fr) repeat(2, auto);
  }

  .dashboard-meal-row span:nth-of-type(3),
  .dashboard-meal-row span:nth-of-type(4) {
    display: none;
  }

  .dashboard-settlement-row {
    grid-template-columns: 1fr 52px;
  }

  .dashboard-settlement-row .dashboard-progress {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .dashboard-product-number {
    max-width: 105px;
  }
}

.org-form-modal,
.account-form-modal,
.staff-form-modal,
.staff-qr-form-modal,
.schedule-copy-modal,
.schedule-template-modal,
.delivery-exception-modal,
.application-review-modal,
.menu-form-modal,
.notification-form-modal,
.print-form-modal {
  width: min(720px, 100%);
}

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

.account-form-modal .form-grid label,
.account-form-modal .form-grid input,
.account-form-modal .form-grid select {
  min-width: 0;
  width: 100%;
}

.notification-form-modal {
  width: min(820px, 100%);
}

.notification-form-modal [hidden] {
  display: none !important;
}

.notification-form-modal .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 12px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.form-section {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.form-section.soft {
  background: var(--panel-soft);
}

.section-title {
  display: grid;
  gap: 3px;
}

.section-title.inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.section-title strong {
  font-size: 16px;
}

.section-title span,
.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.required-mark {
  margin-left: 4px;
  color: var(--warn);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.config-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  height: 26px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.check-pill.ok {
  border-color: #cfe0ca;
  background: var(--green-soft);
  color: var(--green);
}

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

.template-reference div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.template-reference strong,
.template-reference span {
  display: block;
}

.template-reference strong {
  color: var(--green);
  font-size: 13px;
}

.template-reference span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-form {
  margin-bottom: 0;
}

.status-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.status-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  background: #f8faf7;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--panel-soft);
}

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

.badge {
  display: inline-flex;
  height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 12px;
  background: #eef5ec;
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.badge.disabled {
  background: #f2f3f0;
  color: var(--muted);
}

td .badge + .badge {
  margin-left: 4px;
  margin-top: 4px;
}

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

.primary-cell strong,
.primary-cell span,
.status-stack span {
  display: block;
}

.primary-cell strong {
  color: var(--text);
  font-weight: 800;
}

.primary-cell span,
.status-stack .muted,
.time-cell {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.primary-cell .inline-action {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 8px;
  min-height: 28px;
  line-height: 1;
}

.status-stack {
  min-width: 108px;
}

.money-cell {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.time-cell {
  min-width: 138px;
}

.order-detail-modal {
  width: min(980px, 100%);
}

.order-detail-modal .detail-tabs {
  position: sticky;
  top: -24px;
  z-index: 6;
  margin: 6px 0 16px;
  padding: 10px 0;
  background: var(--panel);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.detail-grid.compact {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.detail-info-item,
.detail-money div,
.detail-list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.detail-info-item span,
.detail-money span,
.detail-list-item span,
.detail-list-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-info-item strong,
.detail-money strong,
.detail-list-item strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}

.payment-record-card {
  border-left: 4px solid var(--line);
}

.payment-record-card.success {
  border-left-color: var(--green);
}

.payment-record-card.warning {
  border-left-color: #c7861f;
}

.payment-record-card.danger {
  border-left-color: #c24f35;
}

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

.record-line strong {
  margin-top: 0;
  white-space: nowrap;
}

.record-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4ec;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.record-chip.warning {
  background: #fff7e6;
  color: #9a620f;
}

.record-chip.danger {
  background: #fff0ea;
  color: #a83b24;
}

.detail-money {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-money strong {
  color: var(--green);
  font-size: 22px;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.compact-table {
  font-size: 13px;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

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

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.check-cell {
  display: flex;
  justify-content: center;
}

.check-cell input {
  width: 18px;
  height: 18px;
}

.mini {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #cfe0ca;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mini.danger {
  border-color: #f1c7b7;
  background: #fff3ee;
  color: var(--warn);
}


.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #d9e7d5;
  border-radius: 7px;
  background: #f6fbf4;
}

.notice strong,
.notice span {
  display: block;
}

.notice strong {
  color: var(--green);
  font-size: 15px;
}

.notice span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.notice.warning {
  border-color: #efd2b8;
  background: #fff8ef;
}

.notice.warning strong {
  color: var(--warn);
}

.notice.success {
  border-color: #cfe0ca;
  background: #f1f8ee;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0 2px;
}

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

.page-indicator {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.pagination-actions select {
  min-width: 112px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
}

.menu-product-panel {
  position: relative;
}

.menu-product-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-product-filters {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) minmax(190px, 1.4fr) auto;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.menu-product-filter-actions {
  justify-content: flex-end;
}

.menu-product-workbench {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-width: 0;
  margin-top: 16px;
}

.menu-product-category-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--line);
}

.menu-product-category-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.menu-product-category-item:hover,
.menu-product-category-item.active {
  background: #eef5ec;
  color: var(--green);
}

.menu-product-category-item.active {
  box-shadow: inset 3px 0 0 var(--green);
}

.menu-product-category-item span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-product-category-item strong {
  min-width: 26px;
  color: inherit;
  font-size: 12px;
  text-align: right;
}

.menu-product-category-empty {
  margin: 8px 10px;
}

.menu-product-table-pane {
  min-width: 0;
  padding-left: 16px;
}

.menu-product-table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}

.menu-product-table-summary strong {
  color: var(--text);
}

.menu-product-table-wrap table {
  min-width: 1160px;
}

.selection-column {
  width: 42px;
  text-align: center;
}

.selection-column input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--green);
}

.menu-product-mobile-category {
  display: none;
}

.menu-product-batch-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 0 236px;
  padding: 12px 14px;
  border: 1px solid #bfd4ba;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 32, 24, 0.12);
}

.menu-product-batch-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-product-batch-bar span {
  color: var(--muted);
  font-size: 12px;
}

.menu-product-panel.has-menu-product-selection .menu-product-table-pane {
  padding-bottom: 72px;
}

.menu-product-operation-modal,
.menu-product-import-modal {
  width: min(920px, 100%);
}

.menu-product-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.menu-product-segmented legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  font-weight: 700;
}

.menu-product-segmented label {
  position: relative;
  margin: 0;
}

.menu-product-segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menu-product-segmented span {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.menu-product-segmented input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 0 2px rgba(54, 95, 47, 0.08);
}

.menu-product-segmented label.danger input:checked + span {
  border-color: #e7b6a3;
  background: #fff3ee;
  color: var(--warn);
}

.menu-product-batch-fields {
  margin-bottom: 18px;
}

.menu-product-operation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.menu-product-operation-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.menu-product-operation-summary span,
.menu-product-operation-summary strong {
  display: block;
}

.menu-product-operation-summary span {
  color: var(--muted);
  font-size: 12px;
}

.menu-product-operation-summary strong {
  margin-top: 4px;
  color: var(--green);
  font-size: 22px;
}

.menu-product-operation-summary .warning strong {
  color: #a66b0a;
}

.menu-product-operation-summary .danger strong {
  color: #b64c31;
}

.menu-product-operation-preview {
  max-height: 380px;
  margin-bottom: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.menu-product-operation-preview table {
  min-width: 760px;
}

.menu-product-operation-preview td strong,
.menu-product-operation-preview td span {
  display: block;
}

.menu-product-operation-preview tr.blocked,
.menu-product-operation-preview tr.warning {
  background: #fff8f3;
}

.menu-product-operation-actions {
  position: sticky;
  bottom: -24px;
  z-index: 3;
  margin: 18px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.menu-product-operation-actions > .primary {
  width: auto;
  min-width: 180px;
  margin-top: 0;
}

.menu-product-import-picker {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.menu-product-import-picker .upload-button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.menu-product-import-picker strong,
.menu-product-import-picker span {
  display: block;
  overflow-wrap: anywhere;
}

.menu-product-import-picker span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.menu-product-import-retry {
  margin-bottom: 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.empty,
.empty-cell {
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.preorder-rule-panel {
  overflow: visible;
}

.preorder-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr) auto;
  align-items: end;
  margin-bottom: 8px;
}

.preorder-filters label {
  margin: 0;
}

.preorder-config-section {
  min-width: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.compact-panel-head {
  margin-bottom: 14px;
}

.meal-wave-table-wrap table {
  min-width: 1480px;
}

.meal-wave-table-wrap td strong,
.meal-wave-table-wrap td small {
  display: block;
}

.meal-wave-table-wrap td small {
  margin-top: 4px;
  color: var(--muted);
}

.preorder-config-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.preorder-config-columns > * {
  min-width: 0;
}

.business-period-list,
.wave-exception-list {
  display: grid;
  gap: 8px;
}

.compact-config-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.5fr) minmax(130px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.wave-exception-row {
  grid-template-columns: minmax(100px, 0.7fr) minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(180px, 1.2fr) auto;
}

.meal-wave-modal {
  width: min(780px, 100%);
}

.compact-config-modal {
  width: min(620px, 100%);
}

.meal-wave-modal .form-actions,
.compact-config-modal .form-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 18px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

@media (max-width: 1400px) {
  .preorder-config-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .menu-product-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .cards,
  .dashboard-grid,
  .status-list,
  .detail-grid,
  .detail-money,
  .detail-columns,
  .workbench,
  .release-grid,
  .form-grid,
  .rule-section-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .topbar,
  .panel-head,
  .release-hero,
  .ops-summary,
  .notice,
  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .release-score {
    text-align: left;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .ops-items {
    justify-content: flex-start;
  }

  .preorder-config-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .wave-exception-row {
    grid-template-columns: minmax(100px, 0.7fr) minmax(160px, 1fr) minmax(180px, 1fr) auto;
  }

  .wave-exception-row > :nth-child(4) {
    display: none;
  }

  .menu-product-filters {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 800px) {
  .menu-product-workbench {
    grid-template-columns: 1fr;
  }

  .menu-product-category-sidebar {
    display: none;
  }

  .menu-product-mobile-category {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 14px;
  }

  .menu-product-mobile-category label {
    margin: 0;
    font-weight: 700;
  }

  .menu-product-table-pane {
    padding-left: 0;
  }

  .menu-product-table-summary,
  .menu-product-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-product-table-summary {
    padding: 8px 0;
  }

  .menu-product-batch-bar {
    position: static;
    margin-left: 0;
  }

  .menu-product-panel.has-menu-product-selection .menu-product-table-pane {
    padding-bottom: 0;
  }

  .menu-product-operation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-product-import-picker {
    grid-template-columns: 1fr;
  }

  .menu-product-operation-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .menu-product-operation-actions > .primary,
  .menu-product-operation-actions > .actions,
  .menu-product-operation-actions > .actions button {
    width: 100%;
  }

  .menu-product-batch-bar .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-product-batch-bar .actions button {
    width: 100%;
  }

  .menu-product-header-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .menu-product-header-actions button {
    width: 100%;
  }

  .menu-product-filters {
    grid-template-columns: 1fr;
  }

  .menu-product-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .menu-product-filter-actions button {
    width: 100%;
  }

  .menu-product-table-pane .pagination-actions {
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    overflow-x: auto;
  }

  .logo {
    flex: 0 0 auto;
    margin: 0 10px 0 0;
    font-size: 18px;
  }

  .nav {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 96px;
    margin: 0;
    align-items: center;
  }

  .logout {
    margin: 0;
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .cards,
  .dashboard-grid,
  .dashboard-actions,
  .filters,
  .form-grid,
  .form-grid.two,
  .metric-strip,
  .release-grid,
  .settlement-guide-grid,
  .rule-section-grid {
    grid-template-columns: 1fr;
  }

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

  .product-image-uploader {
    grid-template-columns: 1fr;
  }

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

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

  .detail-grid,
  .detail-grid.compact,
  .detail-money,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-panel {
    padding: 18px;
  }

  .release-action {
    align-items: flex-start;
    flex-direction: column;
  }

  .preorder-filters,
  .compact-config-row,
  .wave-exception-row {
    grid-template-columns: 1fr;
  }

  .compact-config-row .actions {
    justify-content: flex-start;
  }

  .wave-exception-row > :nth-child(4) {
    display: block;
  }

  .meal-wave-modal .form-actions,
  .compact-config-modal .form-actions {
    bottom: -18px;
    margin: 18px -18px -18px;
    padding: 12px 18px;
  }

  .location-panel {
    margin-right: -6px;
    margin-left: -6px;
  }

  .location-panel .panel-head,
  .location-scope-row,
  .location-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .location-toolbar-actions {
    justify-content: flex-start;
  }

  .location-summary-strip {
    justify-content: flex-start;
  }

  .location-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px;
    border-radius: 7px;
    background: #edf2eb;
  }

  .location-mobile-tabs button {
    min-height: 40px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
  }

  .location-mobile-tabs button.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 2px 8px rgba(23, 32, 24, 0.08);
  }

  .location-workbench {
    display: block;
    min-height: 520px;
  }

  .location-workbench[data-mobile-pane="tree"] .location-detail-pane,
  .location-workbench[data-mobile-pane="detail"] .location-tree-pane {
    display: none;
  }

  .location-tree-pane {
    border-right: 0;
  }

  .location-detail-pane {
    padding: 16px;
  }

  .location-tree-list {
    max-height: none;
  }

  .location-detail-grid,
  .location-impact-grid,
  .location-import-picker,
  .location-qr-card {
    grid-template-columns: 1fr;
  }

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

  .location-qr-preview {
    width: min(220px, 100%);
  }

  .location-import-modal {
    overflow-x: hidden;
  }
}

@media (max-width: 1024px) {
  .admin-shell {
    grid-template-columns: 64px 188px minmax(0, 1fr);
  }

  .admin-shell .workspace {
    padding-right: 18px;
    padding-left: 18px;
  }

  .context-bar {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .context-account {
    display: none;
  }

  .feature-settings-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .admin-shell {
    display: block;
  }

  .module-rail {
    position: sticky;
    top: 0;
    height: auto;
    padding: 8px;
    flex-direction: row;
    overflow-x: auto;
  }

  .rail-brand,
  .rail-logout {
    flex: 0 0 auto;
    margin: 0 6px 0 0;
  }

  .rail-groups {
    display: flex;
    gap: 4px;
  }

  .module-group-button {
    flex: 0 0 auto;
    min-width: 58px;
  }

  .module-group-button.active {
    box-shadow: inset 0 -3px 0 var(--lime);
  }

  .module-menu {
    position: sticky;
    top: 60px;
    z-index: 18;
    height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .module-brand,
  .module-menu-heading,
  .module-account {
    display: none;
  }

  .module-menu-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .module-menu-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
  }

  .admin-shell .workspace {
    padding: 0 12px 18px;
  }

  .context-bar {
    position: static;
    grid-template-columns: 1fr 1fr;
    margin: 0 -12px 18px;
    padding: 10px 12px;
  }

  .context-bar label > span {
    font-size: 11px;
  }

  .context-bar select,
  .context-bar input {
    height: 40px;
    font-size: 13px;
  }

  .feature-template-actions {
    width: 100%;
    flex-direction: column;
  }

  .feature-template-actions button {
    width: 100%;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .feature-row-state {
    justify-content: space-between;
  }

  .feature-inherited-source {
    text-align: left;
  }
}

.homepage-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dfe6df;
}

.homepage-toolbar > div:first-child,
.homepage-section-head > div:first-child,
.homepage-meal-rule-link > div {
  display: grid;
  gap: 4px;
}

.homepage-toolbar strong {
  font-size: 20px;
}

.homepage-toolbar span,
.homepage-section-head span,
.homepage-meal-rule-link span {
  color: #6f786f;
  font-size: 13px;
}

.homepage-scope-controls {
  display: flex;
  gap: 10px;
}

.homepage-scope-controls label {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.homepage-scope-controls label span {
  font-size: 12px;
}

.homepage-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  overflow-x: auto;
  background: #eef3ee;
  border: 1px solid #dfe6df;
  border-radius: 8px;
}

.homepage-tabs .tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: #556056;
}

.homepage-tabs .tab.active {
  background: #fff;
  color: #214f2a;
  box-shadow: 0 1px 4px rgba(20, 48, 25, 0.1);
}

.homepage-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 22px;
  margin-top: 16px;
}

.homepage-editor-panel {
  min-width: 0;
  border-top: 1px solid #dfe6df;
}

.homepage-section-block {
  padding: 16px 4px;
  border-bottom: 1px solid #dfe6df;
}

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

.homepage-item-list {
  margin-top: 12px;
  border-top: 1px solid #edf1ed;
}

.homepage-item-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1ed;
}

.homepage-item-row > img,
.homepage-item-icon {
  width: 72px;
  height: 50px;
  border: 1px solid #d8e3d7;
  border-radius: 6px;
  object-fit: cover;
}

.homepage-item-icon {
  display: grid;
  place-items: center;
  background: #eef6ed;
  color: #2f6736;
  font-size: 12px;
  font-weight: 700;
}

.homepage-item-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.homepage-item-copy span,
.homepage-item-copy small {
  overflow: hidden;
  color: #6f786f;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homepage-empty-row {
  margin-top: 12px;
  padding: 18px 0;
  color: #879087;
  font-size: 13px;
}

.homepage-meal-rule-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border-left: 3px solid #8fd925;
  background: #f3f7f2;
}

.homepage-preview-pane {
  position: sticky;
  top: 20px;
}

.homepage-preview-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #626c63;
  font-size: 12px;
}

.homepage-preview-frame {
  width: 390px;
  max-width: 100%;
  height: 720px;
  overflow: hidden;
  border: 1px solid #cfd8cf;
  border-radius: 8px;
  background: #f5f7f4;
  box-shadow: 0 8px 24px rgba(21, 46, 25, 0.12);
}

.preview-nav {
  display: grid;
  place-items: center;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e7ece7;
  color: #172419;
  font-weight: 700;
}

.preview-scroll {
  display: grid;
  gap: 10px;
  height: calc(100% - 52px);
  padding: 14px;
  overflow-y: auto;
}

.preview-welcome {
  font-size: 17px;
  font-weight: 700;
}

.preview-carousel {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #dde8dc;
}

.preview-carousel > img,
.preview-carousel-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-carousel-placeholder {
  display: grid;
  place-items: center;
  color: #69766a;
}

.preview-carousel > div:last-child:not(.preview-carousel-placeholder) {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 12px;
  background: rgba(20, 33, 22, 0.76);
  color: #fff;
}

.preview-announcement,
.preview-service {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #eaded0;
  border-radius: 6px;
  background: #fff8f1;
  color: #5e4d3e;
  font-size: 12px;
}

.preview-shortcuts,
.preview-meals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-shortcuts > div,
.preview-meals > div {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 76px;
  padding: 8px;
  border: 1px solid #e1e8e0;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.preview-shortcuts span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf6e9;
  color: #2e6735;
  font-weight: 700;
}

.preview-meals span,
.preview-meals small,
.preview-product small,
.preview-service span {
  color: #778078;
  font-size: 11px;
}

.preview-section {
  display: grid;
  gap: 8px;
}

.preview-section h4 {
  margin: 0;
  font-size: 14px;
}

.preview-product {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #e4e9e4;
  background: #fff;
}

.preview-product > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #eaf2e7;
  color: #2f6736;
  font-weight: 800;
}

.preview-product > div {
  display: grid;
  min-width: 0;
}

.homepage-item-modal {
  max-width: 720px;
  max-height: min(88vh, 820px);
  overflow-y: auto;
}

.homepage-item-modal [hidden] {
  display: none !important;
}

.homepage-item-modal .form-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 20px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid #dfe6df;
  background: #fff;
}

.homepage-character-count {
  justify-self: end;
  color: #8a928a;
}

.homepage-image-upload {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.homepage-image-upload > div:last-child {
  display: grid;
  gap: 8px;
}

.homepage-image-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #b8c7b7;
  border-radius: 6px;
  background: #f2f6f1;
  color: #7b857b;
}

.homepage-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1100px) {
  .homepage-workspace {
    grid-template-columns: 1fr;
  }

  .homepage-preview-pane {
    position: static;
    width: 390px;
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .homepage-toolbar,
  .homepage-section-head,
  .homepage-meal-rule-link {
    align-items: stretch;
    flex-direction: column;
  }

  .homepage-scope-controls,
  .homepage-image-upload {
    grid-template-columns: 1fr;
    display: grid;
  }

  .homepage-item-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .homepage-item-row > img,
  .homepage-item-icon {
    width: 56px;
    height: 44px;
  }

  .homepage-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .homepage-item-modal .form-actions {
    bottom: -18px;
    margin: 18px -18px -18px;
    padding: 12px 18px;
  }

  .manual-schedule-modal {
    max-height: calc(100vh - 20px);
    padding: 18px 16px 0;
    overflow-y: auto;
  }

  .manual-schedule-context {
    grid-template-columns: 1fr 1fr;
  }

  .manual-schedule-body {
    grid-template-columns: 1fr;
  }

  .manual-schedule-selection {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .manual-schedule-product-list,
  .manual-schedule-selected-list {
    max-height: 230px;
  }

  .manual-schedule-product {
    grid-template-columns: 20px 44px minmax(0, 1fr);
  }

  .manual-schedule-product-image,
  .manual-schedule-product-image .product-thumb,
  .manual-schedule-product-image .missing-thumb {
    width: 44px;
    height: 44px;
  }

  .manual-schedule-product-meta {
    grid-column: 3;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    justify-items: start;
    gap: 8px;
  }

  .manual-schedule-footer {
    align-items: stretch;
    flex-direction: column;
    margin: 0 -16px;
    padding: 10px 16px;
  }

  .manual-schedule-footer .actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .manual-schedule-footer button {
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .manual-schedule-context {
    grid-template-columns: 1fr;
  }

  .manual-schedule-selected-item {
    grid-template-columns: minmax(0, 1fr) 80px;
  }

  .manual-schedule-selected-item .mini {
    grid-column: 2;
  }
}
