:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #20242a;
  --muted: #6b7280;
  --line: #dde2e8;
  --purple: #b64ac9;
  --purple-dark: #87369d;
  --teal: #158c87;
  --coral: #e76555;
  --amber: #c98521;
  --blue: #2f65c8;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(31, 39, 50, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  overflow: auto;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.login-card h1 {
  font-size: 26px;
}

.login-card p,
.login-card small {
  color: var(--muted);
}

.login-card select,
.login-card input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: white;
}

.app-shell.locked {
  display: none;
}

.login-screen.signed-in {
  display: none;
}

body.login-active {
  overflow: hidden;
}

body.login-active .app-shell {
  display: none;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--teal));
}

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

.brand strong {
  font-size: 15px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.nav-item {
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-item span {
  width: 22px;
  text-align: center;
  color: #7b8493;
}

.nav-item.active,
.nav-item:hover {
  background: #f4e9f7;
  color: var(--purple-dark);
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 24px 28px 40px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
}

h2 {
  font-size: 17px;
  margin-bottom: 0;
}

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

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

.source-summary-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.source-summary-grid span,
.source-summary-grid small {
  color: var(--muted);
}

.source-summary-grid strong {
  display: block;
  font-size: 22px;
  margin: 8px 0 4px;
}

.search-box {
  width: min(360px, 42vw);
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.search-box.compact {
  width: min(360px, 100%);
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
}

.user-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e6f4f1;
  color: var(--teal);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.global-search-results {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: -8px 0 18px;
  padding: 14px;
}

.global-search-results.active {
  display: grid;
  gap: 12px;
}

.global-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.global-search-head strong {
  color: var(--text);
}

.global-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.search-result-card {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.search-result-card:hover {
  border-color: var(--purple);
  background: #fff;
}

.search-result-card span,
.search-result-card small,
.search-empty {
  color: var(--muted);
}

.search-result-card strong {
  color: var(--text);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  border-radius: var(--radius);
  border: 1px solid transparent;
  min-height: 38px;
}

.primary-button {
  background: var(--purple);
  color: white;
  padding: 0 16px;
  font-weight: 700;
}

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

.secondary-button,
.ghost-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  padding: 0 14px;
}

.ghost-button {
  min-height: 32px;
  color: var(--blue);
}

.danger-button {
  min-height: 32px;
  background: #fff;
  color: var(--coral);
  border-color: #f1c7c1;
  padding: 0 12px;
}

.danger-soft {
  color: var(--coral);
  border-color: #f1c7c1;
}

.icon-button {
  width: 40px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi,
.panel,
.form-panel,
.import-steps article,
.customer-card,
.project-card,
.staff-card,
.timeline-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi {
  padding: 18px;
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
}

.dashboard-layout,
.expense-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
}

.expense-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.expense-filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.expense-tabs {
  border-bottom: 1px solid var(--line);
}

.expense-filter-panel .toolbar {
  padding: 14px 16px;
  margin-bottom: 0;
}

.expense-category-manager {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.expense-scan-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: 16px;
}

.expense-scan-upload,
.expense-scan-editor {
  display: grid;
  align-content: start;
  gap: 12px;
}

.expense-receipt-preview {
  min-height: 136px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 10px;
}

.expense-receipt-preview:empty::before {
  content: "未选择照片";
  color: var(--muted);
}

.expense-draft-list {
  display: grid;
  gap: 10px;
}

.expense-draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 12px;
}

.expense-draft-card strong {
  color: var(--coral);
  font-size: 18px;
}

.expense-draft-card span,
.expense-draft-card p {
  color: var(--muted);
}

.expense-draft-card p {
  grid-column: 1 / -1;
  margin: 0;
}

.expense-draft-card button {
  grid-row: 1 / 3;
  grid-column: 2;
}

.inline-add {
  display: flex;
  gap: 10px;
}

.inline-add input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  flex: 1;
  min-width: 0;
}

.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 4px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
}

.category-chip button {
  border: 0;
  border-radius: 999px;
  background: #fde8e5;
  color: var(--coral);
  min-height: 24px;
  padding: 0 8px;
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel.wide,
.grow {
  min-width: 0;
}

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

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

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.pagination button[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  background: #f8fafc;
  color: #4b5563;
  font-size: 13px;
}

td.note-cell {
  min-width: 220px;
  white-space: normal;
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar select,
.toolbar input,
label input,
label select,
label textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 8px 10px;
}

.toolbar input {
  min-width: 240px;
}

.customer-grid,
.project-grid,
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.customer-card,
.project-card,
.staff-card {
  padding: 16px;
}

.customer-card {
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.customer-card:hover {
  border-color: var(--purple);
  transform: translateY(-1px);
}

.customer-card header,
.project-card header,
.staff-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 14px;
}

.category-pill {
  flex: 0 0 auto;
  min-width: 132px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  box-shadow: var(--shadow);
}

.category-pill:hover {
  border-color: var(--purple);
}

.category-pill span {
  color: var(--muted);
  font-size: 12px;
}

.mini-text-button {
  justify-self: start;
  min-height: 24px;
  border: 1px solid #cfe0ee;
  border-radius: 6px;
  background: #f6fbff;
  color: var(--blue);
  padding: 0 8px;
  font-size: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f7dfe5;
  color: var(--coral);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #e6f4f1;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

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

.card-actions .primary-button,
.card-actions .ghost-button,
.card-actions .danger-button {
  min-height: 32px;
  padding: 0 12px;
}

.status-warn {
  background: #fff4e3;
  color: var(--amber);
}

.status-danger {
  background: #fde8e5;
  color: var(--coral);
}

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

.method-row {
  display: grid;
  grid-template-columns: 70px 1fr 92px;
  align-items: center;
  gap: 10px;
  color: #374151;
}

.payment-summary-cell {
  display: grid;
  gap: 4px;
  line-height: 1.55;
}

.payment-summary-cell strong {
  color: var(--teal);
}

.payment-summary-cell span {
  color: #374151;
}

.order-day-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.order-day-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-day-controls .ghost-button.active {
  border-color: transparent;
  background: #f4e9f7;
  color: var(--purple-dark);
  font-weight: 800;
}

.order-date-field {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.order-date-field input {
  min-width: 150px;
}

.order-search-box {
  flex: 1 1 260px;
  width: auto;
  max-width: 460px;
}

.order-day-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #eefaf8;
  color: var(--teal);
}

.order-day-summary strong,
.order-day-summary em {
  color: #0f766e;
}

.order-day-summary em {
  margin-left: auto;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
}

.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.order-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.order-card header span,
.order-card header p {
  color: var(--muted);
  font-size: 13px;
}

.order-card header h2 {
  margin: 4px 0;
  font-size: 20px;
}

.order-card header p {
  margin-bottom: 0;
}

.order-card header strong {
  flex: 0 0 auto;
  color: var(--coral);
  font-size: 24px;
  line-height: 1.2;
}

.order-card-fields {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.order-card-fields div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
}

.order-card-fields dt {
  color: var(--muted);
  font-size: 13px;
}

.order-card-fields dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.order-card .row-actions {
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: #e8edf2;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.form-panel {
  padding: 16px;
}

.form-panel,
.modal-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-weight: 700;
}

label input,
label select,
label textarea {
  width: 100%;
  color: var(--text);
  font-weight: 400;
}

.field-block {
  display: grid;
  gap: 8px;
  color: #374151;
  font-weight: 700;
}

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

.check-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font-weight: 500;
}

.check-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

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

.selected-chip-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(14, 148, 139, 0.24);
  border-radius: 999px;
  background: #eafaf7;
  color: var(--teal);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.selected-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0 2px;
}

.selected-project-price {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) 34px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(14, 148, 139, 0.24);
  border-radius: var(--radius);
  background: #eafaf7;
  padding: 10px;
}

.selected-project-price strong,
.selected-project-price small {
  display: block;
}

.selected-project-price small {
  color: var(--muted);
  margin-top: 2px;
}

.selected-project-price label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.selected-project-price input {
  min-width: 0;
  padding: 8px 10px;
}

.selected-project-price button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(14, 148, 139, 0.12);
  color: var(--teal);
  cursor: pointer;
  font-size: 18px;
}

.staff-pick-list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.timeline-item.is-clickable {
  cursor: pointer;
}

.timeline-item.is-clickable:hover {
  border-color: rgba(21, 140, 135, 0.38);
  background: #fbfffe;
}

.legacy-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(14, 148, 139, 0.18);
  border-radius: var(--radius);
  background: #eefbf8;
}

.legacy-meta div {
  min-width: 0;
}

.legacy-meta dt {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.legacy-meta dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 13px;
  word-break: break-word;
}

.service-task-panel {
  margin-bottom: 14px;
}

.service-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.service-task-card {
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.service-task-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.service-task-card header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.staff-reminders {
  margin-bottom: 16px;
}

.note-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 6px;
}

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

.note-summary span {
  color: var(--muted);
}

.media-strip,
.preview-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.media-card {
  width: 112px;
  display: grid;
  gap: 6px;
}

.media-preview {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.media-thumb {
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: #eef2f6;
}

.media-card .media-thumb {
  width: 112px;
  height: 92px;
}

.media-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.media-actions a,
.media-actions button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
}

.video-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.import-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.import-steps article {
  padding: 16px;
}

.import-steps strong {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6f4f1;
  color: var(--teal);
  margin-bottom: 12px;
}

.import-steps p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.check-list span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #f8fafc;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

#customerDetailDialog {
  width: min(1180px, calc(100vw - 24px));
}

#orderDialog {
  width: min(1120px, calc(100vw - 36px));
}

#mediaPreviewDialog {
  width: min(980px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

.modal-form {
  padding: 18px;
}

.media-preview-modal {
  padding: 0;
}

.media-preview-modal > header,
.media-preview-modal > footer {
  min-height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.media-preview-modal > footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.media-preview-body {
  min-height: 360px;
  max-height: min(72vh, 760px);
  padding: 16px;
  background: #101318;
  display: grid;
  place-items: center;
  overflow: auto;
}

.media-preview-body img,
.media-preview-body video {
  max-width: 100%;
  max-height: calc(min(72vh, 760px) - 32px);
  border-radius: var(--radius);
  background: black;
}

.detail-modal {
  display: grid;
  gap: 0;
  padding: 0;
}

.detail-modal > header {
  min-height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.detail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 640px;
  background: #f8fafc;
}

.detail-profile {
  background: white;
  border-right: 1px solid var(--line);
}

.detail-hero {
  min-height: 190px;
  padding: 24px 20px;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, #b64ac9, #7d68d8);
}

.avatar.large {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
  font-size: 28px;
}

.detail-hero h2 {
  font-size: 24px;
  margin: 0 0 6px;
}

.detail-hero span {
  opacity: 0.9;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.profile-list {
  margin: 0;
}

.profile-list div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.profile-list dt {
  color: var(--muted);
}

.profile-list dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.detail-main {
  min-width: 0;
  background: #f8fafc;
}

.detail-tabs {
  display: flex;
  overflow-x: auto;
  background: white;
  border-bottom: 1px solid var(--line);
}

.detail-tabs button {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 54px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #f7f7f8;
  color: #4b5563;
}

.detail-tabs button.active {
  background: white;
  color: var(--purple);
  font-weight: 800;
  box-shadow: inset 0 4px 0 var(--purple);
}

.detail-content {
  padding: 18px;
}

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

.detail-card-grid article {
  min-height: 108px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.detail-card-grid strong {
  font-size: 24px;
}

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

.modal-form.large {
  width: 100%;
}

.modal-form header,
.modal-form footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-form footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

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

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.field-with-action .secondary-button {
  min-height: 40px;
  white-space: nowrap;
}

.payment-split-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.payment-split-head,
.payment-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.payment-row-list {
  display: grid;
  gap: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.payment-row .danger-button {
  min-height: 40px;
}

.payment-row .danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.payment-total {
  justify-content: flex-end;
  color: var(--coral);
}

.is-hidden {
  display: none !important;
}

.quick-project-list {
  grid-column: 1 / -1;
  display: none;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.quick-project-list.active {
  display: grid;
}

.quick-project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 10px 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.quick-project-card.is-selected {
  border-color: var(--purple);
  background: #fbf2ff;
  box-shadow: inset 0 0 0 1px rgba(184, 71, 205, 0.18);
}

.quick-project-card strong,
.quick-project-card span {
  display: block;
}

.quick-project-card small {
  color: var(--muted);
}

.quick-project-card .price {
  color: var(--coral);
  font-weight: 800;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

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

.empty-state.compact {
  padding: 12px;
  text-align: left;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    height: auto;
    padding: 10px;
    top: 0;
  }

  .brand {
    padding-bottom: 10px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-top: 10px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .main {
    padding: 18px 14px 88px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .kpi-grid,
  .dashboard-layout,
  .expense-layout,
  .expense-kpis,
  .import-steps,
  .source-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .field-with-action {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-profile {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  th,
  td {
    padding: 10px;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 42px;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
  }

  .topbar-actions .user-pill,
  .topbar-actions #logoutBtn {
    grid-column: auto;
  }

  .customer-grid,
  .project-grid,
  .staff-grid {
    grid-template-columns: 1fr;
  }

  .detail-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #f3f5f7;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 8px 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(31, 39, 50, 0.06);
  }

  .brand {
    min-height: 48px;
    padding: 0 2px 8px;
    border-bottom: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    font-size: 11px;
  }

  .nav-list {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(31, 39, 50, 0.08);
  }

  .nav-item {
    flex: 0 0 68px;
    height: 54px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0;
    font-size: 13px;
  }

  .nav-item span {
    width: auto;
    font-size: 16px;
  }

  .main {
    padding: 10px 10px 92px;
    width: 100%;
    overflow-x: hidden;
  }

  .topbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .eyebrow {
    display: none;
  }

  h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .topbar-actions .search-box {
    grid-column: 1 / -1;
  }

  .topbar-actions .user-pill {
    position: fixed;
    top: 12px;
    right: 64px;
    z-index: 70;
    max-width: 132px;
    min-height: 30px;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 9px;
    font-size: 12px;
    border-radius: var(--radius);
  }

  .topbar-actions #logoutBtn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 70;
    min-height: 30px;
    width: 46px;
    padding: 0;
    font-size: 12px;
    white-space: nowrap;
  }

  .topbar-actions #captureBtn {
    display: none;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
    min-height: 46px;
    font-size: 17px;
  }

  .search-box {
    width: 100%;
    min-height: 46px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .kpi {
    min-height: 104px;
    padding: 14px;
    display: grid;
    align-content: center;
  }

  .kpi strong {
    font-size: 23px;
    margin: 6px 0;
  }

  .kpi span,
  .kpi small {
    font-size: 12px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .toolbar > * {
    width: 100%;
    min-height: 44px;
  }

  .toolbar .search-box,
  .toolbar select,
  .toolbar input {
    grid-column: 1 / -1;
  }

  .order-day-panel {
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  .order-day-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .order-day-controls .ghost-button {
    min-height: 42px;
  }

  .order-date-field,
  .order-search-box {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }

  .order-date-field {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .order-date-field input {
    min-width: 0;
    width: 100%;
  }

  .order-day-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    padding: 10px;
  }

  .order-day-summary em {
    grid-column: 1 / -1;
    margin-left: 0;
    font-size: 24px;
  }

  .order-card {
    padding: 14px;
    border-radius: 10px;
  }

  .order-card header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .order-card header h2 {
    font-size: 19px;
  }

  .order-card header strong {
    font-size: 24px;
  }

  .order-card-fields div {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .order-card .row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-card,
  .project-card,
  .staff-card,
  .panel,
  .form-panel,
  .timeline-item,
  .service-task-card {
    border-radius: 10px;
  }

  .panel,
  .form-panel,
  .customer-card,
  .project-card,
  .staff-card,
  .timeline-item {
    padding: 14px;
  }

  .panel-head {
    margin-bottom: 10px;
    align-items: flex-start;
  }

  .card-actions,
  .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    white-space: normal;
  }

  .card-actions button,
  .row-actions button,
  .service-task-card button {
    min-height: 42px;
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .pagination span {
    width: 100%;
    text-align: center;
    order: -1;
  }

  .timeline-item {
    gap: 9px;
  }

  .timeline-item .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .timeline-item h2 {
    font-size: 18px;
    line-height: 1.35;
  }

  .timeline-item p {
    line-height: 1.65;
    margin-bottom: 0;
    word-break: break-word;
  }

  .timeline-item .row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .timeline-item .row-actions span {
    color: var(--muted);
    font-size: 14px;
  }

  .timeline-item.is-clickable:active {
    transform: scale(0.997);
    background: #f6fffd;
  }

  .legacy-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 9px 10px;
  }

  .media-card {
    width: 96px;
  }

  .media-card .media-thumb {
    width: 96px;
    height: 82px;
  }

  .service-task-grid,
  .customer-grid,
  .project-grid,
  .staff-grid {
    grid-template-columns: 1fr;
  }

  .service-task-card {
    padding: 14px;
    gap: 10px;
  }

  .service-task-card .meta {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: var(--radius);
    padding: 10px;
    line-height: 1.7;
  }

  .service-task-card .primary-button {
    width: 100%;
  }

  .customer-card h2,
  .project-card h2,
  .staff-card h2 {
    font-size: 19px;
  }

  .customer-card .meta,
  .project-card .meta,
  .staff-card .meta {
    line-height: 1.7;
  }

  dialog,
  #orderDialog,
  #customerDetailDialog,
  #mediaPreviewDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }

  .modal-form,
  .detail-modal,
  .media-preview-modal {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: auto;
  }

  .modal-form {
    padding: 16px;
  }

  .modal-form header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white;
    padding-bottom: 8px;
  }

  .modal-form footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px 0 max(0px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 18px rgba(31, 39, 50, 0.08);
  }

  .modal-form footer button {
    flex: 1;
    min-height: 46px;
  }

  .form-grid {
    gap: 12px;
  }

  .field-with-action {
    gap: 8px;
  }

  .payment-split-head {
    align-items: stretch;
  }

  .payment-split-head .secondary-button {
    min-height: 40px;
  }

  .payment-row {
    grid-template-columns: 1fr;
  }

  .quick-project-list {
    max-height: 280px;
    padding: 8px;
  }

  .quick-project-card {
    min-height: 66px;
    padding: 12px;
  }

  .quick-project-card .price {
    font-size: 14px;
  }

  .check-list,
  .staff-pick-list {
    grid-template-columns: 1fr;
  }

  .detail-modal > header {
    min-height: 52px;
  }

  .detail-layout {
    min-height: auto;
  }

  .detail-profile {
    padding: 0;
  }

  .detail-hero {
    padding: 22px 16px;
  }

  .detail-actions {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .profile-list div {
    padding: 12px 14px;
  }

  .detail-tabs button {
    min-width: 96px;
    min-height: 48px;
  }

  .detail-content {
    padding: 12px;
  }

  .expense-layout {
    gap: 12px;
  }

  .expense-scan-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .expense-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .expense-kpis .kpi {
    min-height: 96px;
    padding: 12px 8px;
  }

  .expense-kpis .kpi strong {
    font-size: 18px;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table:has(#recentOrders),
  table:has(#orderTable),
  table:has(#staffReminderTable),
  table:has(#expenseTable) {
    display: block;
    background: transparent;
  }

  table:has(#recentOrders) thead,
  table:has(#orderTable) thead,
  table:has(#staffReminderTable) thead,
  table:has(#expenseTable) thead {
    display: none;
  }

  table:has(#recentOrders) tbody,
  table:has(#orderTable) tbody,
  table:has(#staffReminderTable) tbody,
  table:has(#expenseTable) tbody {
    display: grid;
    gap: 10px;
  }

  table:has(#recentOrders) tr,
  table:has(#orderTable) tr,
  table:has(#staffReminderTable) tr,
  table:has(#expenseTable) tr {
    display: grid;
    gap: 9px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    box-shadow: var(--shadow);
  }

  table:has(#recentOrders) td,
  table:has(#orderTable) td,
  table:has(#staffReminderTable) td,
  table:has(#expenseTable) td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 0;
    text-align: right;
    line-height: 1.45;
  }

  table:has(#recentOrders) td::before,
  table:has(#orderTable) td::before,
  table:has(#staffReminderTable) td::before,
  table:has(#expenseTable) td::before {
    color: var(--muted);
    flex: 0 0 auto;
    text-align: left;
    font-size: 13px;
  }

  table:has(#recentOrders) td:nth-child(2),
  table:has(#orderTable) td:nth-child(2),
  table:has(#staffReminderTable) td:nth-child(2) {
    display: block;
    text-align: left;
    font-size: 17px;
    font-weight: 800;
  }

  table:has(#recentOrders) td:nth-child(2)::before,
  table:has(#orderTable) td:nth-child(2)::before,
  table:has(#staffReminderTable) td:nth-child(2)::before {
    display: block;
    margin-bottom: 2px;
    font-weight: 400;
  }

  table:has(#recentOrders) td:nth-child(3),
  table:has(#orderTable) td:nth-child(3),
  table:has(#staffReminderTable) td:nth-child(3) {
    display: block;
    text-align: left;
  }

  table:has(#recentOrders) td:nth-child(3)::before,
  table:has(#orderTable) td:nth-child(3)::before,
  table:has(#staffReminderTable) td:nth-child(3)::before {
    display: block;
    margin-bottom: 2px;
  }

  table:has(#orderTable) td:nth-child(4),
  table:has(#recentOrders) td:nth-child(5),
  table:has(#staffReminderTable) td:nth-child(5),
  table:has(#expenseTable) td:nth-child(4) {
    color: var(--coral);
    font-weight: 900;
    font-size: 17px;
  }

  table:has(#recentOrders) td:nth-child(1)::before,
  table:has(#orderTable) td:nth-child(1)::before,
  table:has(#staffReminderTable) td:nth-child(1)::before,
  table:has(#expenseTable) td:nth-child(1)::before {
    content: "日期";
  }

  table:has(#recentOrders) td:nth-child(2)::before,
  table:has(#orderTable) td:nth-child(2)::before,
  table:has(#staffReminderTable) td:nth-child(2)::before {
    content: "顾客";
  }

  table:has(#recentOrders) td:nth-child(3)::before,
  table:has(#orderTable) td:nth-child(3)::before,
  table:has(#staffReminderTable) td:nth-child(3)::before {
    content: "项目";
  }

  table:has(#recentOrders) td:nth-child(4)::before {
    content: "收款";
  }

  table:has(#recentOrders) td:nth-child(5)::before,
  table:has(#orderTable) td:nth-child(4)::before,
  table:has(#staffReminderTable) td:nth-child(5)::before,
  table:has(#expenseTable) td:nth-child(4)::before {
    content: "金额";
  }

  table:has(#orderTable) td:nth-child(5)::before {
    content: "收款明细";
  }

  table:has(#recentOrders) td:nth-child(6)::before {
    content: "收款笔数";
  }

  table:has(#orderTable) td:nth-child(6)::before {
    content: "小记";
  }

  table:has(#orderTable) td:nth-child(7)::before {
    content: "员工";
  }

  table:has(#orderTable) td:nth-child(8),
  table:has(#staffReminderTable) td:nth-child(6) {
    display: block;
    text-align: left;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }

  table:has(#orderTable) td:nth-child(8)::before,
  table:has(#staffReminderTable) td:nth-child(6)::before {
    content: "";
  }

  table:has(#orderTable) {
    width: 100%;
    min-width: 0;
  }

  table:has(#orderTable) tr {
    gap: 10px;
    padding: 16px;
  }

  table:has(#orderTable) td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    text-align: left;
    min-width: 0;
  }

  table:has(#orderTable) td::before {
    padding-top: 1px;
  }

  table:has(#orderTable) td:nth-child(1) {
    color: var(--muted);
    font-size: 13px;
  }

  table:has(#orderTable) td:nth-child(2) {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    font-size: 18px;
  }

  table:has(#orderTable) td:nth-child(2)::before {
    margin-bottom: 0;
  }

  table:has(#orderTable) td:nth-child(2) .meta {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }

  table:has(#orderTable) td:nth-child(3) {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  table:has(#orderTable) td:nth-child(3)::before {
    margin-bottom: 0;
  }

  table:has(#orderTable) td:nth-child(4) {
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 10px 12px;
    border-radius: var(--radius);
    background: #fff7f4;
    font-size: 22px;
  }

  table:has(#orderTable) td:nth-child(5) {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: #f8fafc;
  }

  table:has(#orderTable) td:nth-child(5)::before {
    display: block;
    margin-bottom: 6px;
  }

  table:has(#orderTable) .payment-summary-cell {
    gap: 6px;
  }

  table:has(#orderTable) .payment-summary-cell strong {
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    background: #e6f4f1;
    padding: 0 9px;
    font-size: 12px;
  }

  table:has(#orderTable) td:nth-child(6),
  table:has(#orderTable) td:nth-child(7) {
    grid-template-columns: 76px minmax(0, 1fr);
    color: #374151;
  }

  table:has(#orderTable) td:nth-child(8) {
    padding-top: 10px;
  }

  table:has(#orderTable) td:nth-child(8) .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  table:has(#orderTable) td:nth-child(8) .row-actions button {
    min-width: 0;
    width: 100%;
  }

  table:has(#staffReminderTable) td:nth-child(4)::before {
    content: "服务人员";
  }

  table:has(#expenseTable) td:nth-child(2)::before {
    content: "类别";
  }

  table:has(#expenseTable) td:nth-child(3)::before {
    content: "支出人";
  }

  table:has(#expenseTable) td:nth-child(5)::before {
    content: "备注";
  }

  table:has(#expenseTable) td:nth-child(6)::before {
    content: "凭证";
  }

  .global-search-results.active {
    position: sticky;
    top: 72px;
    z-index: 20;
  }
}

@media (max-width: 380px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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