:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #697586;
  --line: #d9dee7;
  --brand: #0f8b8d;
  --brand-dark: #0a6264;
  --accent: #f2b544;
  --danger: #d64545;
  --success: #198754;
  --shadow: 0 18px 46px rgba(25, 35, 50, .12);
}

* {
  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", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.front-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.front-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-weight: 500;
}

.front-main {
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    linear-gradient(115deg, rgba(15, 139, 141, .12), transparent 38%),
    linear-gradient(245deg, rgba(242, 181, 68, .16), transparent 42%),
    var(--bg);
}

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

.login-card h1,
.install-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p,
.install-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.btn,
button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover,
button:hover {
  background: var(--brand-dark);
}

.btn.secondary,
button.secondary {
  background: #e8edf3;
  color: var(--text);
}

.btn.secondary:hover,
button.secondary:hover {
  background: #dce3ec;
}

.btn.danger,
button.danger {
  background: var(--danger);
}

button.small,
.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

button.tiny,
.btn.tiny {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 5px;
}

.login-cta {
  min-width: 132px;
  background: var(--accent);
  color: #2f2306;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

label {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}

textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 139, 141, .2);
  border-color: var(--brand);
}

.flash {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #eef6ff;
  color: #15507c;
  line-height: 1.5;
}

.flash.success {
  background: #eaf7ee;
  color: #155f33;
  border-color: #bce3c8;
}

.flash.error {
  background: #fff0f0;
  color: #9d2424;
  border-color: #f3c1c1;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 184px 1fr;
}

.sidebar {
  background: #18212f;
  color: #fff;
  padding: 18px 11px;
}

.sidebar .brand {
  margin-bottom: 20px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 7px;
  padding: 0 10px;
  color: rgba(255, 255, 255, .78);
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.content {
  min-width: 0;
  padding: 22px clamp(14px, 3vw, 34px);
}

.mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.page-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
}

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

.overview-head {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f8 58%, #fff7e6 100%);
}

.overview-head h1 {
  margin: 0;
  font-size: 24px;
}

.overview-head button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.overview-cycle {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #344054;
}

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

.metric,
.panel,
.settings-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

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

.metric strong {
  font-size: 24px;
}

.overview-metrics {
  gap: 16px;
}

.stat-card {
  position: relative;
  min-height: 74px;
  overflow: hidden;
  padding: 14px 96px 14px 16px;
  color: #fff;
  border: 0;
  box-shadow: 0 16px 34px rgba(25, 35, 50, .13);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 50%;
  width: 58px;
  height: 58px;
  border: 7px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  transform: translateY(-50%);
}

.stat-card span,
.stat-card small,
.stat-card strong {
  position: relative;
  z-index: 1;
}

.stat-card span {
  color: rgba(255, 255, 255, .84);
  font-size: 14px;
  margin-bottom: 8px;
}

.stat-card .stat-number {
  display: block;
  position: absolute;
  right: 22px;
  top: 50%;
  z-index: 2;
  width: 72px;
  transform: translateY(-50%);
  text-align: center;
  font-size: 30px;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 0;
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
}

.stat-total {
  background: linear-gradient(135deg, #0f8b8d, #126b90);
}

.stat-month {
  background: linear-gradient(135deg, #2563eb, #14a3a8);
}

.stat-week {
  background: linear-gradient(135deg, #7c3aed, #2f80ed);
}

.stat-today {
  background: linear-gradient(135deg, #d97706, #e14d4d);
}

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

.report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(25, 35, 50, .09);
}

.report-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #1f4f8f, #0f8b8d);
}

.report-card-head h2 {
  margin: 0;
  font-size: 20px;
}

.report-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
}

.report-date-filter {
  margin: 0;
}

.report-date-filter input {
  min-height: 28px;
  width: 132px;
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  padding: 3px 7px;
  font-size: 12px;
}

.report-date-filter input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .88;
}

.report-card-head span {
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
}

.report-card-head strong {
  font-size: 28px;
  white-space: nowrap;
}

.report-card-placeholder .report-card-head {
  background: linear-gradient(135deg, #334155, #0f8b8d);
}

.placeholder-body {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 208px;
  padding: 16px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.placeholder-body strong {
  color: #1f2933;
  font-size: 18px;
}

.service-report-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px;
}

.service-finance-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 8px 10px;
  border: 1px solid #cfe9dd;
  border-radius: 6px;
  background: #f1fbf5;
  color: #184b32;
  font-size: 13px;
}

.service-finance-row strong,
.service-finance-row b {
  white-space: nowrap;
}

.finance-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.service-finance-row span {
  white-space: nowrap;
}

.service-finance-row em {
  color: #a45b00;
  font-style: normal;
  font-weight: 800;
}

.service-mini-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #e4e9f1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
}

.service-mini-card strong,
.service-mini-card b {
  color: #101828;
}

.report-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.report-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
}

.report-summary-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 6px;
  padding: 0 9px;
  background: #eef7f7;
  color: #0a6264;
  font-size: 12px;
  font-weight: 800;
}

.report-receipt-total {
  margin: 0 16px 12px;
  padding: 8px 10px;
  border: 1px solid #f4cf95;
  border-radius: 6px;
  background: #fff8eb;
  color: #8a4b00;
  font-size: 13px;
  font-weight: 900;
}

.report-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  color: #344054;
  font-weight: 800;
}

.report-foot span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 6px;
  padding: 0 9px;
  background: #eef7f7;
  color: #0a6264;
  font-size: 12px;
}

.report-total-line {
  justify-content: flex-start;
}

.report-detail-btn {
  margin-left: auto;
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.recent-groups {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
}

.recent-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: visible;
  background: #fff;
}

.recent-day summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
  background: #f7fafc;
}

.recent-day summary strong {
  color: #1f2933;
}

.recent-day summary span {
  color: var(--muted);
  font-weight: 800;
}

.day-summary-date {
  font-size: 13px;
}

.day-summary-counts {
  margin-left: 1em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recent-day .table-wrap {
  border-top: 1px solid var(--line);
}

.recent-day .data-table th,
.recent-day .data-table td {
  padding: 4px 7px;
  line-height: 1.15;
}

.recent-day .combo-pill,
.recent-day .badge {
  min-height: 20px;
  padding: 1px 6px;
}

.recent-day .table-empty-cell,
.panel .recent-groups + .empty {
  height: 58px;
  padding: 18px 12px;
}

.panel {
  overflow: visible;
}

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

.recent-panel .panel-head {
  padding: 8px 12px;
}

.recent-panel .panel-head h2 {
  font-size: 16px;
}

.recent-panel .panel-note {
  font-size: 12px;
}

.recent-panel .btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.panel-head.order-list-head {
  justify-content: flex-start;
  flex-wrap: wrap;
  column-gap: 16px;
}

.receipt-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
}

.receipt-account-picker {
  position: relative;
  max-width: 100%;
}

.receipt-account-picker summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
}

.receipt-account-picker summary::-webkit-details-marker {
  display: none;
}

.receipt-account-picker summary::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin: -3px 2px 0;
  border: solid var(--muted);
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}

.receipt-account-selection {
  color: var(--muted);
}

summary .receipt-account-selection {
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-account-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  gap: 8px;
  min-width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(16 24 40 / 14%);
}

.receipt-account-options {
  display: grid;
  max-height: min(240px, 45vh);
  overflow-y: auto;
}

.receipt-filter .check-row {
  margin: 0;
  gap: 5px;
  white-space: nowrap;
}

.receipt-account-options .check-row {
  padding: 6px 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.receipt-account-options input {
  flex: none;
}

.order-receipt-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.order-receipt-totals span {
  white-space: nowrap;
}

.order-receipt-totals strong {
  color: var(--text);
}

@media (max-width: 520px) {
  .order-list-head .receipt-filter {
    flex-basis: 100%;
  }
}

.panel-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}

.data-table {
  min-width: 0;
  border: 1px solid var(--line);
  table-layout: fixed;
}

.order-list-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.order-list-table .col-date {
  width: 6%;
}

.order-list-table .col-serial {
  width: 4%;
}

.order-list-table .col-service {
  width: 6.5%;
}

.order-list-table .col-size {
  width: 5%;
}

.order-list-table .col-area {
  width: 6%;
}

.order-list-table .col-address {
  width: 8%;
}

.order-list-table .col-payment {
  width: 6.5%;
}

.order-list-table .col-amount {
  width: 5%;
}

.order-list-table .col-assigned {
  width: 6%;
}

.order-list-table .col-host {
  width: 6%;
}

.order-list-table .col-feedback {
  width: 6%;
}

.order-list-table .col-reason {
  width: 13%;
}

.order-list-table .col-combo {
  width: 14%;
}

.order-list-table .col-action {
  width: 4%;
}

.order-list-table.receipt-account-orders .col-payment {
  width: 3.25%;
}

.order-list-table.receipt-account-orders .col-date,
.order-list-table.receipt-account-orders .col-service,
.order-list-table.receipt-account-orders .col-area {
  width: 8%;
}

.order-list-table.receipt-account-orders .col-address {
  width: auto;
}

.order-list-table.receipt-account-orders .col-amount {
  width: 7%;
}

.order-list-table.receipt-account-orders .col-combo {
  width: 24%;
}

@media (max-width: 1000px) {
  .order-list-table.receipt-account-orders .col-payment {
    width: 30px;
  }
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 5px 6px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
}

.order-list-table th,
.order-list-table td {
  padding: 4px 5px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}

.order-list-table .combo-pill,
.order-list-table .badge {
  min-height: 20px;
  max-width: 100%;
  padding: 1px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-table.receipt-account-orders .payment-column,
.order-list-table.receipt-account-orders .payment-column .pay-badge {
  padding-inline: 1px;
}

.receipt-account-orders .payment-column .order-table-filter-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.receipt-account-orders .payment-column .filter-th-label {
  display: block;
  line-height: 1.15;
  white-space: normal;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.order-list-table th:last-child,
.order-list-table td:last-child {
  overflow: visible;
}

.order-list-table tr.action-row-open,
.order-list-table tr.action-row-open td {
  position: relative;
  z-index: 120;
  overflow: visible;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

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

.data-table.is-filtering tbody {
  opacity: .55;
  transition: opacity .12s ease;
}

th {
  background: #f9fafb;
  color: #4b5563;
}

.data-table th {
  background: #38aeea;
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.order-table-filter-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  gap: 2px;
  margin: 0;
  white-space: nowrap;
}

.filter-th-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 20px;
}

.table-filter-control {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.table-filter-select {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 18px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  opacity: 0;
}

.table-filter-select option {
  color: var(--text);
  font-size: 12px;
}

.filter-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, .9);
}

.table-filter-control.active .filter-caret {
  border-top-color: #fff06a;
}

.table-empty-cell {
  height: 72px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.satisfaction-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.satisfaction-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(25, 35, 50, .08);
}

.satisfaction-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.satisfaction-card strong {
  color: #0f8b8d;
  font-size: 30px;
  line-height: 1;
}

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

.satisfaction-table {
  min-width: 0;
}

.combo-pay {
  display: inline-grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.15fr);
  width: 100%;
  align-items: center;
  gap: 3px;
}

.combo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  border-radius: 5px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-service {
  background: #e8f7ee;
  color: #157347;
  border: 1px solid #b9e5c9;
}

.combo-method {
  background: #fff3df;
  color: #a45b00;
  border: 1px solid #f4cf95;
}

.combo-amount {
  background: #fff0f0;
  color: #c1272d;
  border: 1px solid #f2b7ba;
}

.muted-text {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
}

.service-badge {
  min-width: 36px;
}

.service-c1 {
  background: #e8f7ee;
  color: #157347;
  border-color: #b9e5c9;
}

.service-c2 {
  background: #e9f1ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.service-c3 {
  background: #fff5df;
  color: #a45b00;
  border-color: #f4cf95;
}

.service-c4 {
  background: #f1e9ff;
  color: #6d28d9;
  border-color: #d8c4fe;
}

.service-c5 {
  background: #e8fbff;
  color: #087990;
  border-color: #aeeaf5;
}

.service-c6 {
  background: #ffeaf1;
  color: #be185d;
  border-color: #fbcfe8;
}

.service-c7 {
  background: #eefdf3;
  color: #15803d;
  border-color: #bbf7d0;
}

.service-c8 {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}

.service-c9 {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
}

.service-c10 {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.service-c11 {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}

.pay-wechat {
  background: #e8f7ee;
  color: #157347;
  border-color: #b9e5c9;
}

.pay-alipay {
  background: #e9f1ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.pay-pending {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.pay-cash {
  background: #fff0f0;
  color: #c1272d;
  border-color: #f2b7ba;
}

.pay-meituan {
  background: #fff8db;
  color: #8a6200;
  border-color: #f6d85d;
}

.pay-default {
  background: #eef2f7;
  color: #344054;
  border-color: #d9dee7;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.row-actions form {
  margin: 0;
}

.action-menu {
  position: relative;
  display: inline-flex;
  z-index: 150;
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 600;
  display: none;
  min-width: 78px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(25, 35, 50, .14);
}

.floating-action-menu-panel {
  position: fixed;
  z-index: 3000;
}

.review-date-filter {
  display: flex;
  align-items: center;
  align-self: flex-end;
  gap: 8px;
  margin: 0 0 1px;
}

.review-date-filter label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.review-date-filter input {
  min-height: 36px;
}

.review-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.review-pending {
  background: #e8f7ee;
  color: #157347;
  border-color: #b9e5c9;
}

.review-done {
  background: #fff0f0;
  color: #c1272d;
  border-color: #f2b7ba;
}

.action-menu.open .action-menu-panel {
  display: grid;
  gap: 2px;
}

.menu-item {
  min-height: 28px;
  width: 100%;
  justify-content: flex-start;
  padding: 0 9px;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.menu-item:hover {
  background: #eef7f7;
  color: var(--text);
}

.danger-text {
  color: var(--danger);
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-block {
  padding: 16px;
}

.settings-block h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 4px;
}

.switch {
  width: auto;
  min-height: auto;
  transform: scale(1.3);
}

.settings-inline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 320px);
  align-items: end;
  gap: 18px;
}

.settings-top-grid {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(260px, 340px) minmax(150px, auto);
  align-items: end;
  justify-content: start;
  gap: 18px;
}

.inline-check {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.inline-check .switch {
  margin: 0;
}

.finance-field {
  max-width: 320px;
  margin: 0;
}

.compact-field {
  width: 100%;
}

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

.import-panel,
.import-preview-panel {
  margin-top: 14px;
}

.import-form {
  padding: 14px;
}

.import-textarea {
  min-height: 220px;
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.6;
}

.import-actions {
  padding: 12px 14px 14px;
}

.import-preview-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.import-preview-table .row-error td {
  background: #fff7f7;
}

.import-preview-panel .import-actions {
  display: grid;
  justify-items: end;
  width: 100%;
}

.import-edit-wrap {
  width: 100%;
}

.import-cell-input {
  width: 100%;
  min-height: 26px;
  padding: 3px 4px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.2;
}

.combo-edit {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3px;
  align-items: center;
}

.combo-edit .import-cell-input {
  text-align: center;
}

.status-ok,
.status-error {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-ok {
  background: #e8f7ee;
  color: #157347;
  border: 1px solid #b9e5c9;
}

.status-error {
  background: #fff0f0;
  color: #c1272d;
  border: 1px solid #f2b7ba;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 40, .54);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(100%, 644px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 12px 14px;
}

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

.report-detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report-detail-body pre {
  min-height: 190px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

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

.order-form-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 10px;
}

.order-form-grid .field {
  gap: 4px;
  margin-bottom: 8px;
}

.order-form-grid label {
  font-size: 12px;
}

.order-form-grid input,
.order-form-grid select {
  min-height: 34px;
  padding: 6px 7px;
  font-size: 13px;
}

.row-third {
  grid-column: span 2;
}

.row-half {
  grid-column: span 3;
}

.field input[readonly] {
  background: #f4f6f8;
  color: #344054;
}

.full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 2px 0 8px;
}

.check-line .check-row {
  margin: 0;
}

.combined-fields {
  display: none;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.combined-fields.show {
  display: grid;
}

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

  .sidebar {
    display: none;
  }

  .mobile-head {
    display: flex;
  }

  .mobile-head select {
    max-width: 170px;
  }

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

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

  .settings-inline,
  .settings-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .front-topbar {
    align-items: stretch;
  }

  .login-cta {
    min-width: 110px;
  }

  .login-card,
  .install-card {
    padding: 18px;
  }

  .content {
    padding: 14px;
  }

  .page-head {
    display: grid;
  }

  .metrics,
  .satisfaction-metrics,
  .settings-grid,
  .settings-top-grid,
  .report-grid,
  .form-grid:not(.order-form-grid),
  .combined-fields {
    grid-template-columns: 1fr;
  }

  .order-form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 6px;
  }

  .order-form-grid .field {
    gap: 5px;
  }

  .order-form-grid label {
    font-size: 12px;
  }

  .order-form-grid input,
  .order-form-grid select {
    min-height: 34px;
    padding: 6px 5px;
    font-size: 12px;
  }

  .modal-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}
