:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-deep: #edf2f7;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dfe7ef;
  --line-strong: #c4d1dd;
  --text: #16212b;
  --muted: #667384;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --green: #078066;
  --green-soft: #e8f7f3;
  --yellow-soft: #fff7e6;
  --yellow: #946313;
  --red: #c83e3e;
  --red-soft: #fff1f1;
  --shadow: 0 16px 38px rgba(24, 42, 62, 0.09);
  --shadow-soft: 0 8px 22px rgba(24, 42, 62, 0.055);
  --radius: 8px;
  --field-height: 40px;
  --button-height: 38px;
  --button-min-width: 84px;
  --toolbar-button-min-width: 116px;
  --table-button-height: 32px;
  --table-button-width: 82px;
  --body-top: #f7f9fc;
  --sidebar-bg: rgba(251, 253, 255, 0.96);
  --topbar-bg: rgba(244, 247, 251, 0.96);
}

/* 服务项目编辑：三块上下排列，区块内部保持横向表单布局。 */
.service-editor-dialog .service-editor-form-body {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.service-editor-dialog .service-editor-layout,
.service-editor-dialog .service-editor-layout.service-flow-collapsed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 46px;
  width: 100%;
  height: auto;
  gap: 10px;
  min-width: 0;
  min-height: 100%;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
}

.service-editor-dialog .service-editor-layout:not(.service-flow-collapsed) {
  grid-template-rows: auto auto auto;
  height: auto;
  align-content: start;
  overflow-y: auto;
  padding-right: 4px;
}

.service-editor-dialog .service-identity-section,
.service-editor-dialog .service-editor-side,
.service-editor-dialog .service-flow-section {
  grid-column: 1;
  min-width: 0;
}

.service-editor-dialog .service-identity-section {
  grid-row: 1;
}

.service-editor-dialog .service-editor-side {
  grid-row: 2;
  align-self: stretch;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.service-editor-dialog .service-editor-layout.service-flow-collapsed .service-editor-side {
  min-height: auto;
  overflow: visible;
}

.service-editor-dialog .service-flow-section {
  grid-row: 3;
  align-self: stretch;
  width: 100%;
  max-height: none;
}

.service-editor-dialog .service-identity-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1fr) minmax(130px, 0.7fr) minmax(170px, 0.9fr);
  gap: 8px;
  min-width: 0;
}

.service-editor-dialog .service-identity-grid .service-basic-field {
  min-width: 0;
}

.service-editor-dialog .service-category-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.service-editor-dialog .service-category-control select {
  flex: 1 1 auto;
  min-width: 0;
}

.service-editor-dialog .service-category-control .mini-btn {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 0 8px;
}

.service-editor-dialog .service-editor-side > .service-basic-section {
  flex: 0 0 auto;
  min-height: 0;
}

.service-editor-dialog .service-editor-side .service-basic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "name name name"
    "processing price quote"
    "note note note";
}

.service-editor-dialog .service-editor-side .service-name-field { grid-area: name; }
.service-editor-dialog .service-editor-side .service-processing-field { grid-area: processing; }
.service-editor-dialog .service-editor-side .service-price-field { grid-area: price; }
.service-editor-dialog .service-editor-side .service-quote-field { grid-area: quote; }
.service-editor-dialog .service-editor-side .service-note-field {
  grid-area: note;
  grid-column: 1 / -1;
  margin-top: 0;
}

.service-editor-dialog .service-editor-side .service-basic-field > textarea {
  min-height: 74px;
  max-height: 120px;
  resize: vertical;
}

.service-editor-dialog .service-flow-section.is-collapsed {
  align-items: stretch;
  min-height: 46px;
  padding: 0 12px;
  background: var(--panel-soft);
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-section-title {
  flex: 1 1 auto;
  flex-direction: row;
  justify-content: space-between;
  min-height: 46px;
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-title-text {
  max-height: none;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  writing-mode: horizontal-tb;
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-editor,
.service-editor-dialog .service-flow-section.is-collapsed .service-flow-help {
  display: none;
}

.service-editor-dialog .service-flow-section:not(.is-collapsed) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 460px;
  height: auto;
  overflow: visible;
}

.service-editor-dialog .service-editor-layout:not(.service-flow-collapsed) .service-editor-side {
  height: auto;
  min-height: auto;
  overflow: visible;
}

.service-editor-dialog .service-flow-section:not(.is-collapsed) .service-flow-editor {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

@media (max-width: 700px) {
  .service-editor-dialog .service-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-editor-dialog .service-identity-grid > .service-basic-field:first-child {
    grid-column: 1 / -1;
  }

  .service-editor-dialog .service-category-control {
    gap: 6px;
  }

  .service-editor-dialog .service-category-control .mini-btn {
    min-width: 68px;
    padding: 0 6px;
  }

  .service-editor-dialog .service-editor-side .service-basic-grid,
  .service-editor-dialog .service-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-editor-dialog .service-editor-side .service-basic-grid {
    grid-template-areas:
      "name name"
      "processing price"
      "quote quote"
      "note note";
  }
}

@media (max-width: 440px) {
  .service-editor-dialog .service-identity-grid,
  .service-editor-dialog .service-editor-side .service-basic-grid,
  .service-editor-dialog .service-profile-grid {
    grid-template-columns: 1fr;
  }

  .service-editor-dialog .service-editor-side .service-basic-grid {
    grid-template-areas:
      "name"
      "processing"
      "price"
      "quote"
      "note";
  }

  .service-editor-dialog .service-identity-grid > .service-basic-field:first-child {
    grid-column: auto;
  }

  .service-editor-dialog .service-category-control {
    flex-wrap: wrap;
  }

  .service-editor-dialog .service-category-control select {
    flex-basis: 100%;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1722;
  --bg-deep: #0a1018;
  --panel: #151f2d;
  --panel-soft: #101a27;
  --line: #304055;
  --line-strong: #4a5d75;
  --text: #dbe6f2;
  --muted: #a9b8c9;
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --green: #2dd4bf;
  --green-soft: rgba(45, 212, 191, 0.14);
  --yellow-soft: rgba(245, 158, 11, 0.14);
  --yellow: #fbbf24;
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.22);
  --body-top: #0a1018;
  --sidebar-bg: rgba(14, 22, 33, 0.96);
  --topbar-bg: rgba(15, 23, 34, 0.95);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--body-top) 0%, var(--bg) 220px);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease, box-shadow 0.24s ease, opacity 0.24s ease;
}

body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.admin-feedback-table-wrap::-webkit-scrollbar,
.nav-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.admin-feedback-table-wrap::-webkit-scrollbar-thumb,
.nav-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #bdcad7;
  background-clip: content-box;
}

body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.admin-feedback-table-wrap::-webkit-scrollbar-track,
.nav-list::-webkit-scrollbar-track {
  background: transparent;
}

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

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

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

body.login-mode .app-shell {
  display: block;
}

body.login-mode .sidebar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  min-height: 0;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 6px 8px 14px;
  text-align: center;
}

.brand-logo {
  width: 152px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
}

html[data-theme="dark"] .brand-logo,
html[data-theme="dark"] .login-logo {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #123d64;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(18, 61, 100, 0.18);
}

.brand-title {
  color: #111827;
  font-size: 18px;
  font-weight: 850;
}

.brand .brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.brand-subtitle,
.server-label,
.server-url,
.message {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-clock {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  justify-items: center;
  padding: 0 8px 6px;
  color: var(--muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sidebar-clock-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.sidebar-clock-time {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.nav-list {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  grid-auto-rows: 44px;
  align-content: start;
  align-items: start;
  min-height: 0;
  max-height: none;
  padding-right: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  flex: 0 0 44px;
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #526071;
  text-align: left;
  padding: 0 14px;
  font-size: 14px;
  line-height: 1.25;
}

.nav-item.active,
.nav-item:hover {
  border-color: #b9d3ef;
  background: var(--blue-soft);
  color: #174ea6;
  font-weight: 850;
  box-shadow: inset 3px 0 0 var(--blue);
}

.server-status-card {
  display: grid;
  flex: 0 0 auto;
  gap: 0;
  max-height: none;
  margin-top: auto;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.server-status-card.is-expanded {
  gap: 9px;
  max-height: 276px;
}

.server-status-card:not(.is-expanded) .server-status-body {
  display: none;
}

.server-status-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.server-status-head,
.server-status-metric-head,
.server-status-metric-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.server-status-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.server-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.server-status-card.is-online .server-status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.server-status-card.is-error .server-status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.server-status-text {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-body,
.server-status-disks {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.server-status-body {
  max-height: 218px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.server-status-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.server-status-metric-head {
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.server-status-metric-head strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.server-status-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-deep);
}

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

.server-status-metric-meta {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.server-status-metric-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-loading {
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.server-box {
  flex: 0 0 auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 42, 62, 0.045);
}

.server-url {
  margin-top: 5px;
  word-break: break-all;
}

.content {
  min-width: 0;
  width: min(100%, 1520px);
  margin: 0 auto;
  overflow-x: hidden;
  padding: 24px 32px 42px;
}

body.login-mode .content {
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  margin: -24px -32px 24px;
  padding: 20px 32px 17px;
  border-bottom: 1px solid rgba(223, 231, 239, 0.88);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
}

body.login-mode .topbar {
  position: fixed;
  inset: 0 0 auto 0;
  justify-content: flex-end;
  min-height: auto;
  margin: 0;
  padding: 28px clamp(22px, 7vw, 84px);
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

body.login-mode .topbar > div:first-child {
  display: none;
}

h1 {
  margin: 0;
  color: #101820;
  font-size: 27px;
  line-height: 1.2;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--button-height);
  height: var(--button-height);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--blue);
  box-shadow: 0 8px 18px rgba(24, 42, 62, 0.045);
}

.theme-btn:hover {
  border-color: #9bbff0;
  background: var(--blue-soft);
}

.palette-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.palette-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.palette-icon span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.palette-icon span:nth-child(1) {
  top: 4px;
  left: 5px;
}

.palette-icon span:nth-child(2) {
  top: 5px;
  right: 5px;
}

.palette-icon span:nth-child(3) {
  left: 6px;
  bottom: 5px;
}

.admin-menu {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: var(--button-height);
  max-width: min(260px, 38vw);
  padding: 3px 12px 3px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: #1f2d3a;
  box-shadow: 0 8px 18px rgba(24, 42, 62, 0.045);
}

.admin-menu:hover {
  border-color: #9bbff0;
  background: #f8fbff;
  color: #174ea6;
}

.admin-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f3ff 0%, #e8f7f3 100%);
  color: #0b63ce;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
}

.admin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 780;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-more-dots {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.info-more-dots i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.admin-menu:hover .admin-more-dots,
.admin-menu:focus-visible .admin-more-dots {
  border-color: var(--line-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.primary-btn,
.secondary-btn,
.inline-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--button-height);
  min-width: var(--button-min-width);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.top-actions .secondary-btn {
  min-width: 68px;
}

.primary-btn {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(7, 128, 102, 0.15);
}

.primary-btn:hover {
  background: #066f5a;
  border-color: #066f5a;
}

.secondary-btn,
.inline-btn {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #1d5bbd;
}

.secondary-btn:hover,
.inline-btn:hover {
  border-color: #94b8de;
  background: var(--blue-soft);
}

.inline-btn:disabled,
.inline-btn:disabled:hover {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
}

.danger-btn {
  border: 1px solid #f2c7c7;
  background: var(--red-soft);
  color: var(--red);
}

.danger-btn:hover {
  border-color: #e8aaaa;
  background: #ffe8e8;
}

.danger-btn:disabled,
.danger-btn:disabled:hover {
  cursor: not-allowed;
  border-color: #f0caca;
  background: #fff1f1;
  color: #b33a3a;
  box-shadow: none;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 130px);
}

body.login-mode .login-panel {
  min-height: 100vh;
  padding: 98px 24px 56px;
}

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

.login-logo {
  display: block;
  width: 290px;
  max-width: 86%;
  height: auto;
  margin: 0 auto 10px;
}

.login-system-title {
  margin: 0 0 24px;
  color: #111827;
  font-size: 18px;
  font-weight: 860;
  letter-spacing: 0;
  text-align: center;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #4d5b6a;
  font-size: 13px;
  font-weight: 820;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input,
select {
  height: var(--field-height);
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.login-card .primary-btn {
  width: 100%;
  min-width: 0;
  margin-top: 22px;
}

.message {
  min-height: 18px;
  margin-top: 12px;
}

.admin-panel {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
  animation: tabFade 0.22s ease both;
}

.tab-panel[data-panel="dashboard"].active {
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 150px);
  min-height: 0;
  max-height: calc(100vh - 150px);
}

/* Match standard management pages to the dashboard's visible workspace. */
.tab-panel.active:not([data-panel="dashboard"]) {
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 150px);
  min-height: 0;
  max-height: calc(100vh - 150px);
}

.tab-panel.active:not([data-panel="dashboard"]) > .table-card,
.tab-panel.active:not([data-panel="dashboard"]) > .test-order-page {
  height: 100%;
  min-height: 0;
}

.tab-panel[data-panel="finance"] > .finance-page {
  height: 100%;
  min-height: 0;
}

.tab-panel.active:not([data-panel="dashboard"]) .table-wrap {
  max-height: none;
}

.tab-panel[data-panel="testOrders"] .test-order-page {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.tab-panel[data-panel="testOrders"] .order-workbench {
  height: 100%;
  min-height: 0;
}

.tab-panel[data-panel="testOrders"] .order-table-wrap {
  max-height: none;
}

.tab-panel[data-panel="taskLogs"] .events-list,
.tab-panel[data-panel="taskLogs"] .task-log-grid,
.tab-panel[data-panel="taskLogs"] .task-log-card,
.tab-panel[data-panel="taskLogs"] .event-list-panel,
.tab-panel[data-panel="taskLogs"] .login-record-list {
  min-height: 0;
}

.tab-panel[data-panel="taskLogs"] .events-list,
.tab-panel[data-panel="taskLogs"] .task-log-grid {
  flex: 1;
  height: 100%;
}

.tab-panel[data-panel="taskLogs"] .task-log-card {
  display: flex;
  flex-direction: column;
}

.tab-panel[data-panel="taskLogs"] .event-list-panel,
.tab-panel[data-panel="taskLogs"] .login-record-list {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

.tab-panel.active > * {
  min-width: 0;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(260px, 3fr) minmax(300px, 4fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.dashboard-left {
  display: grid;
  grid-column: span 1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

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

.workbench-card:hover,
.stat-card:hover,
.table-card:hover {
  box-shadow: var(--shadow);
}

.workbench-card[data-action],
.stat-card[data-action] {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.workbench-card[data-action]:hover,
.stat-card[data-action]:hover,
.workbench-card[data-action]:focus-visible,
.stat-card[data-action]:focus-visible {
  border-color: var(--line-strong);
  outline: 0;
  transform: translateY(-1px);
}

.workbench-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 122px;
  padding: 18px 20px;
  text-align: center;
}

.workbench-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.workbench-value {
  margin-top: 10px;
  color: #174ea6;
  font-size: 30px;
  font-weight: 900;
}

.workbench-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-info-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.dashboard-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.dashboard-info-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-info-heading .card-title-text {
  line-height: 1.2;
}

.dashboard-info-heading .card-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-info-filter {
  display: grid;
  flex: 0 1 352px;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.dashboard-info-filter .dashboard-date-range {
  grid-column: auto;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
  gap: 6px;
}

.dashboard-info-filter .primary-btn,
.dashboard-info-filter .secondary-btn {
  height: var(--field-height);
  width: 72px;
  min-width: 72px;
  border-radius: 8px;
  padding: 0 10px;
}

.dashboard-info-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dashboard-info-body::-webkit-scrollbar {
  width: 8px;
}

.dashboard-info-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
  background-clip: padding-box;
}

.dashboard-info-body::-webkit-scrollbar-track {
  background: transparent;
}

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

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

.dashboard-notice-item:hover,
.dashboard-notice-item:focus-visible {
  border-color: var(--line);
  background: var(--panel-soft);
  outline: 0;
}

.dashboard-notice-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--blue);
}

.dashboard-notice-dot.return,
.dashboard-notice-dot.invoice {
  background: var(--yellow);
}

.dashboard-notice-dot.data,
.dashboard-notice-dot.wallet {
  background: var(--green);
}

.dashboard-notice-dot.realname,
.dashboard-notice-dot.settlement {
  background: var(--red);
}

.dashboard-notice-dot.assignment.unread {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.dashboard-notice-dot.assignment:not(.unread) {
  background: var(--muted);
}

.dashboard-notice-item.is-unread .dashboard-notice-main strong {
  color: var(--red);
}

.dashboard-notice-main {
  display: grid;
  min-width: 0;
}

.dashboard-notice-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-notice-main small,
.dashboard-notice-time {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-notice-time {
  max-width: 116px;
  text-align: right;
}

.dashboard-order-wrap {
  min-height: 100%;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard-order-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.dashboard-order-table th,
.dashboard-order-table td {
  height: 46px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  vertical-align: middle;
}

.dashboard-order-table th {
  color: var(--muted);
  font-weight: 850;
}

.dashboard-order-table tbody tr {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.dashboard-order-table tbody tr:hover,
.dashboard-order-table tbody tr:focus-visible {
  background: var(--panel-soft);
  outline: 0;
}

.dashboard-order-number {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-order-number.is-reassignment-unread {
  color: var(--yellow);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--yellow) 45%, transparent);
  text-underline-offset: 3px;
}

.dashboard-info-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.order-visual-card {
  display: flex;
  flex-direction: column;
  grid-column: span 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.dashboard-notice-card {
  grid-column: span 1;
}

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

.order-metric-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.order-metric-btn {
  height: 30px;
  min-width: 78px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.order-metric-btn.active,
.order-metric-btn:hover {
  background: #ffffff;
  color: var(--blue);
  box-shadow: 0 6px 14px rgba(24, 42, 62, 0.08);
}

.order-metric-btn:focus-visible {
  outline-offset: 1px;
}

.order-visual-body {
  display: grid;
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
  padding: 14px 16px;
}

.order-visual-panels {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.order-visual-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 6px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 6px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.order-visual-panel:not(.is-empty) {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 12px;
  padding: 10px 0 0;
}

.order-panel-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.order-visual-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.order-visual-panel .order-visual-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  align-self: stretch;
  justify-items: stretch;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  gap: 14px;
  min-height: 0;
}

.order-visual-summary {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}

.order-donut-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
}

.order-visual-panel .order-donut-wrap {
  width: 154px;
  height: 154px;
}

.order-donut {
  width: 210px;
  height: 210px;
}

.order-visual-panel .order-donut {
  width: 154px;
  height: 154px;
}

.order-donut-bg,
.order-slice {
  fill: none;
  stroke-width: 28;
}

.order-donut-bg {
  stroke: var(--panel-soft);
}

.order-slice {
  cursor: pointer;
  transform: rotate(-90deg);
  transform-origin: 90px 90px;
  transition: stroke-width 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.order-slice:hover {
  stroke-width: 33;
  filter: drop-shadow(0 7px 8px rgba(24, 42, 62, 0.18));
  opacity: 0.9;
}

.order-donut-center {
  position: absolute;
  inset: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 999px;
  background: var(--panel);
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.order-visual-panel .order-donut-center {
  inset: 38px;
}

.order-donut-center strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.order-visual-panel .order-donut-center strong {
  font-size: 20px;
}

.order-visual-panel .order-donut-center span {
  font-size: 12px;
}

.order-donut-center span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.order-visual-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.order-visual-panel .order-visual-side {
  display: block;
  align-self: stretch;
  width: 100%;
  min-height: 0;
}

.order-visual-total {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.order-visual-panel .order-visual-total {
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.order-visual-panel .order-visual-total small {
  font-size: 12px;
}

.order-visual-panel .order-visual-total strong {
  font-size: 20px;
  line-height: 1.1;
}

.order-visual-total span,
.order-visual-total small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-visual-total strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.order-legend {
  display: grid;
  gap: 5px;
  max-height: 152px;
  overflow-y: auto;
  padding-right: 4px;
}

.order-visual-panel .order-legend {
  align-content: start;
  align-self: stretch;
  width: 100%;
  grid-auto-rows: minmax(38px, auto);
  gap: 4px;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 5px 7px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  scrollbar-gutter: stable;
}

.order-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.order-visual-panel .order-legend-item {
  min-height: 38px;
  align-items: center;
  padding: 2px 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.order-legend-item:hover {
  background: var(--panel-soft);
  transform: translateX(2px);
}

.order-visual-panel .order-legend-item:hover {
  background: #ffffff;
}

.order-legend-item > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
}

.order-legend-item strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-visual-panel .order-legend-item strong {
  overflow: visible;
  line-height: 1.28;
  text-overflow: clip;
  white-space: normal;
}

.order-legend-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.order-visual-panel .order-legend-item small {
  margin-top: 1px;
  font-size: 11px;
}

.order-visual-empty {
  display: grid;
  place-items: center;
  padding: 18px 0 2px;
  text-align: center;
}

.order-visual-panel .order-visual-empty {
  align-self: center;
  padding: 12px 0 0;
}

.order-empty-circle {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border: 24px solid var(--panel-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 30px;
  font-weight: 900;
}

.order-visual-panel .order-empty-circle {
  width: 96px;
  height: 96px;
  border-width: 15px;
  font-size: 22px;
}

.order-empty-desc {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 104px;
  padding: 18px;
  text-align: center;
}

.stat-value {
  color: #101820;
  font-size: 28px;
  font-weight: 900;
}

.stat-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.table-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Keep long user-entered text inside its current panel instead of widening the page. */
.admin-panel,
.tab-panel,
.dashboard-main,
.dashboard-left,
.stats-grid,
.workbench-grid,
.test-order-page,
.order-workbench,
.card-toolbar,
.card-title,
.admin-dialog,
.admin-dialog-head,
.admin-form-section,
.admin-form-section-body,
.service-flow-editor,
.service-flow-step,
.activity-lottery-config,
.activity-lottery-row,
.user-detail-head,
.order-detail-grid,
.order-detail-row {
  min-width: 0;
  max-width: 100%;
}

.card-toolbar > :first-child,
.admin-dialog-title-group,
.user-detail-title,
.order-detail-value,
.admin-form-field,
.activity-lottery-preview > div,
.service-flow-step-head > * {
  min-width: 0;
}

.card-desc,
.admin-dialog-desc,
.activity-lottery-note,
.service-flow-help,
.order-detail-value,
.feedback-reply-cell,
.admin-form-field small {
  overflow-wrap: anywhere;
}

.card-title {
  display: flex;
  align-items: center;
  min-height: 66px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  color: #111827;
  font-size: 17px;
  font-weight: 850;
}

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.card-toolbar .card-title-text,
.card-title {
  letter-spacing: 0;
}

.card-toolbar > div {
  min-width: 0;
}

.card-toolbar > button {
  flex: 0 0 auto;
  min-width: var(--toolbar-button-min-width);
}

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

.toolbar-actions .primary-btn,
.toolbar-actions .secondary-btn {
  min-width: var(--toolbar-button-min-width);
}

.card-title-text {
  color: #111827;
  font-size: 17px;
  font-weight: 850;
}

.card-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.finance-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.finance-kpi {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 96px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(34, 55, 80, 0.04);
}

.finance-kpi > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.finance-kpi > strong {
  margin-top: 7px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
}

.finance-kpi > small {
  min-height: 17px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.finance-kpi.pending {
  border-color: #f0d8a4;
  background: #fffdf7;
}

.finance-kpi.pending > strong {
  color: #a36408;
}

.finance-kpi.debt {
  border-color: #f2c8cc;
  background: #fffafb;
}

.finance-kpi.debt > strong {
  color: #bf3642;
}

.finance-table-card {
  min-height: 0;
}

.finance-toolbar {
  min-height: 70px;
}

.finance-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.finance-filter-bar select {
  width: 130px;
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.finance-filter-bar .primary-btn,
.finance-filter-bar .secondary-btn {
  min-width: 70px;
}

.finance-table-wrap {
  max-height: none;
}

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

.finance-table-wrap .enhanced-table th,
.finance-table-wrap .enhanced-table td {
  padding: 10px 8px;
}

.finance-table-wrap .enhanced-table th {
  padding-right: 14px;
}

.finance-order-no {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-order-cell,
.finance-amount-cell,
.finance-received-cell,
.finance-tax-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

.finance-order-cell strong,
.finance-amount-cell strong,
.finance-received-cell strong,
.finance-tax-cell strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-order-cell small,
.finance-amount-cell small,
.finance-received-cell small,
.finance-tax-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-money-strong {
  color: #0c6f5a;
  font-weight: 900;
}

.finance-net-money {
  color: #1f5f9d;
  font-weight: 900;
}

.finance-amount-cell strong {
  color: #0c6f5a;
}

.finance-received-cell.pending strong {
  color: #a36408;
}

.finance-row-actions {
  min-width: 86px;
}

.admin-dialog.finance-tax-dialog {
  display: flex;
  flex-direction: column;
  width: min(460px, calc(100vw - 32px));
  max-height: min(calc(100vh - 40px), 480px);
  padding: 0;
  overflow: hidden;
}

.finance-tax-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.finance-tax-dialog > .finance-tax-form {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 18px 22px 20px;
}

.finance-default-tax-field {
  max-width: 260px;
  gap: 8px;
}

.finance-default-tax-field > span:first-child {
  color: #344454;
  font-size: 13px;
  font-weight: 850;
}

.finance-default-tax-input {
  position: relative;
  display: block;
}

.finance-default-tax-input input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 0 42px 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 46px;
  outline: none;
}

.finance-default-tax-input input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.finance-default-tax-input i {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
  pointer-events: none;
  transform: translateY(-50%);
}

.finance-default-tax-field small {
  margin-top: 2px;
}

.finance-tax-dialog > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.finance-tax-dialog .admin-dialog-actions .primary-btn,
.finance-tax-dialog .admin-dialog-actions .secondary-btn {
  min-width: 92px;
}

.admin-dialog.finance-order-tax-dialog {
  display: flex;
  flex-direction: column;
  width: min(660px, calc(100vw - 32px));
  max-height: min(calc(100vh - 40px), 660px);
  padding: 0;
  overflow: hidden;
}

.finance-order-tax-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 19px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.finance-order-tax-dialog > .finance-tax-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 16px 22px;
  gap: 14px;
  overflow-y: auto;
}

.finance-order-tax-dialog > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.finance-order-tax-dialog .admin-dialog-actions .primary-btn,
.finance-order-tax-dialog .admin-dialog-actions .secondary-btn {
  min-width: 96px;
}

.finance-tax-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.finance-tax-summary-item {
  display: grid;
  align-content: center;
  min-height: 72px;
  padding: 11px 16px;
  color: var(--muted);
  font-size: 12px;
}

.finance-tax-summary-item + .finance-tax-summary-item {
  border-left: 1px solid var(--line);
}

.finance-tax-summary-item strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.finance-tax-summary-item.key {
  background: #f1fbf8;
}

.finance-tax-summary-item.key strong {
  color: #087d68;
}

.finance-tax-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.finance-tax-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.finance-tax-section-head > div {
  display: grid;
  gap: 3px;
}

.finance-tax-section-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.finance-tax-section-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.finance-order-tax-dialog .finance-invoice-choice {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.finance-tax-rate-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  align-items: center;
  gap: 16px;
  min-height: 44px;
  color: #344454;
  font-size: 13px;
  font-weight: 850;
}

.finance-tax-rate-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.finance-tax-rate-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.finance-tax-rate-input input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.finance-tax-rate-input input:disabled {
  cursor: not-allowed;
  color: var(--muted);
}

.finance-tax-rate-input:has(input:disabled) {
  background: var(--panel-soft);
}

.finance-tax-rate-input i {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.finance-tax-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #cfe8df;
  border-radius: 6px;
  background: #fbfffd;
}

.finance-tax-result > div {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.finance-tax-result > div + div {
  border-left: 1px solid #cfe8df;
}

.finance-tax-result strong {
  margin-top: 5px;
  color: #087d68;
  font-size: 18px;
  font-weight: 900;
}

.admin-dialog.finance-reconcile-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(calc(100vh - 40px), 760px);
  padding: 0;
  overflow: hidden;
}

.finance-tax-form,
.finance-reconcile-form {
  padding: 18px 22px 8px;
}

.finance-dialog-note {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.finance-invoice-choice,
.finance-settlement-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.finance-invoice-choice input,
.finance-settlement-choice input {
  width: 16px;
  height: 16px;
}

.finance-tax-form {
  display: grid;
  gap: 14px;
}

.finance-reconcile-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 19px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.finance-reconcile-dialog > .finance-reconcile-form {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 8px 22px 0;
  overflow-y: auto;
  scrollbar-gutter: auto;
}

.finance-reconcile-dialog > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.finance-reconcile-dialog .admin-dialog-actions .primary-btn,
.finance-reconcile-dialog .admin-dialog-actions .secondary-btn {
  min-width: 96px;
}

.finance-reconcile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.finance-reconcile-summary-item {
  display: grid;
  align-content: center;
  min-height: 68px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.finance-reconcile-summary-item + .finance-reconcile-summary-item {
  border-left: 1px solid var(--line);
}

.finance-reconcile-summary-item > strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.finance-reconcile-summary-item.key {
  background: #f1fbf8;
}

.finance-reconcile-summary-item.key > strong {
  color: #087d68;
}

.finance-reconcile-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.finance-reconcile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 22px;
  margin-bottom: 7px;
}

.finance-reconcile-section-head > div {
  display: grid;
  gap: 3px;
}

.finance-reconcile-section-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.finance-reconcile-section-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.finance-reconcile-workflow-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-reconcile-workflow-fields > .admin-form-field,
.finance-reconcile-workflow-fields > .finance-settlement-choice,
.finance-reconcile-workflow-fields > .finance-reconcile-invoice-choice,
.finance-reconcile-workflow-fields > .finance-reconcile-tax-preview {
  min-width: 0;
}

.finance-reconcile-workflow-fields > .finance-reconcile-actual-field,
.finance-reconcile-workflow-fields > .finance-reconcile-tax-field {
  grid-column: span 2;
}

.finance-reconcile-invoice-choice {
  align-self: end;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.finance-reconcile-tax-field .finance-tax-rate-input {
  height: 42px;
}

.finance-reconcile-tax-preview {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #cfe8df;
  border-radius: 6px;
  background: #fbfffd;
  color: var(--muted);
  font-size: 12px;
  gap: 10px;
  white-space: nowrap;
}

.finance-reconcile-tax-preview b,
.finance-reconcile-tax-preview strong {
  color: #087d68;
  font-size: 13px;
  font-weight: 900;
}

.finance-order-deduction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.finance-order-deduction {
  display: grid;
  align-content: center;
  min-height: 66px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.finance-order-deduction + .finance-order-deduction {
  border-left: 1px solid var(--line);
}

.finance-order-deduction strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.finance-order-deduction small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-reconcile-tax-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 12px;
  align-items: end;
}

.finance-reconcile-tax-amounts > * {
  min-width: 0;
}

.finance-reconcile-tax-amounts .admin-form-field {
  gap: 6px;
}

.finance-reconcile-calculated-field {
  display: grid;
  align-content: center;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.finance-reconcile-calculated-field > span {
  color: #344454;
  font-size: 12px;
  font-weight: 850;
}

.finance-reconcile-calculated-field > strong {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-reconcile-calculated-field > small {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-reconcile-calculated-field.key {
  border-color: #cfe8df;
  background: #fbfffd;
}

.finance-reconcile-calculated-field.key > strong {
  color: #087d68;
}

.finance-reconcile-dialog .admin-form-field {
  gap: 6px;
}

.finance-reconcile-dialog .admin-form-field > span:first-child {
  color: #344454;
  font-size: 12px;
  font-weight: 850;
}

.finance-money-input {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.finance-money-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.finance-money-input > i {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.finance-money-input > input {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.finance-reconcile-dialog .admin-form-field > select,
.finance-reconcile-dialog .admin-form-field > input[type="datetime-local"] {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.finance-reconcile-dialog .admin-form-field > select:focus,
.finance-reconcile-dialog .admin-form-field > input[type="datetime-local"]:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.finance-reconcile-payment-fields {
  grid-template-columns: 1.15fr 0.85fr;
}

.finance-reconcile-actual-field .finance-money-input {
  border-color: #a8dccc;
  background: #fbfffd;
}

.finance-settlement-choice {
  align-self: end;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.finance-reconcile-note {
  margin-top: 9px;
}

.finance-reconcile-note textarea {
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: none;
}

@media (max-width: 620px) {
  .admin-dialog.finance-order-tax-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .finance-order-tax-dialog > .admin-dialog-head,
  .finance-order-tax-dialog > .finance-tax-form,
  .finance-order-tax-dialog > .admin-dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .finance-tax-summary,
  .finance-tax-result,
  .finance-tax-rate-field {
    grid-template-columns: 1fr;
  }

  .finance-tax-summary-item + .finance-tax-summary-item,
  .finance-tax-result > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .finance-tax-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-order-tax-dialog .finance-invoice-choice {
    width: 100%;
  }

  .finance-reconcile-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  .finance-reconcile-dialog > .admin-dialog-head,
  .finance-reconcile-dialog > .finance-reconcile-form,
  .finance-reconcile-dialog > .admin-dialog-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .finance-reconcile-summary,
  .finance-reconcile-fields,
  .finance-reconcile-payment-fields,
  .finance-reconcile-workflow-fields,
  .finance-reconcile-tax-amounts {
    grid-template-columns: 1fr;
  }

  .finance-order-deduction-grid {
    grid-template-columns: 1fr;
  }

  .finance-order-deduction + .finance-order-deduction {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .finance-reconcile-workflow-fields > .finance-reconcile-actual-field,
  .finance-reconcile-workflow-fields > .finance-reconcile-tax-field {
    grid-column: auto;
  }

  .finance-reconcile-tax-preview {
    min-height: 42px;
  }

  .finance-reconcile-summary-item + .finance-reconcile-summary-item {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .finance-reconcile-section-head {
    align-items: flex-start;
  }
}

.table-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 108px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  isolation: isolate;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

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

table.enhanced-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: center;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: #5b6877;
  font-weight: 850;
  white-space: nowrap;
}

td {
  color: var(--text);
}

.enhanced-table th,
.enhanced-table td {
  border-right: 1px solid var(--line);
}

.enhanced-table td {
  min-width: 0;
  overflow: hidden;
}

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

.enhanced-table.has-sticky-action th:last-child,
.enhanced-table.has-sticky-action td:last-child {
  position: sticky;
  right: 0;
  background: var(--panel);
  background-clip: padding-box;
  box-shadow: -1px 0 0 var(--line), -12px 0 20px rgba(24, 42, 62, 0.04);
}

.enhanced-table.has-sticky-action th:last-child {
  z-index: 5;
  background: var(--panel-soft);
}

.enhanced-table.has-sticky-action td:last-child {
  z-index: 2;
}

.enhanced-table.has-sticky-action tbody tr:hover td:last-child {
  background: #fbfdff;
}

.enhanced-table.has-sticky-action td:last-child {
  overflow: visible;
}

.enhanced-table.has-sticky-action td:last-child .row-actions {
  max-width: 100%;
  min-width: 0;
}

.enhanced-table th {
  overflow: visible;
  padding-right: 18px;
}

.table-heading-content,
.cell-content {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-line-cell {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-note-cell {
  min-width: 180px;
}

#servicesTable table {
  min-width: 1120px;
}

#servicesTable th,
#servicesTable td {
  padding: 11px 12px;
}

#servicesTable th:nth-child(1),
#servicesTable td:nth-child(1) {
  padding-right: 8px;
  padding-left: 8px;
}

#servicesTable th:nth-child(2),
#servicesTable td:nth-child(2) {
  overflow: hidden;
  padding-right: 10px;
  padding-left: 10px;
}

#servicesTable .service-thumb {
  width: 68px;
  max-width: 100%;
  height: 46px;
  line-height: 46px;
}

#servicesTable .empty-thumb {
  display: grid;
  place-items: center;
  line-height: 1.2;
}

.service-sort-help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.table-resize-handle {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 4;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.table-resize-handle::after {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 4px;
  width: 2px;
  border-radius: 999px;
  background: #cbd8e6;
  opacity: 0;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.enhanced-table th:hover .table-resize-handle::after,
.enhanced-table.is-resizing-table .table-resize-handle::after {
  opacity: 1;
}

.table-resize-handle:hover::after,
.enhanced-table.is-resizing-table .table-resize-handle::after {
  background: var(--blue);
}

body.table-resizing,
body.table-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

tbody tr {
  transition: background-color 0.16s ease;
}

tbody tr:hover {
  background: #fbfdff;
}

.table-wrap > .empty,
.admin-feedback-list > .empty,
.events-list > .empty {
  display: grid;
  min-height: 112px;
  margin: 14px;
  padding: 42px 20px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

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

.tag.warn {
  background: #fff0e4;
  color: #a85c18;
}

.tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.tag.muted {
  background: var(--panel-soft);
  color: var(--muted);
}

.text-danger {
  color: var(--red);
  font-weight: 850;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.user-list-profile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.user-list-profile.compact {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 2px 0;
}

.user-list-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.user-list-profile.compact .user-list-avatar {
  width: 38px;
  height: 38px;
  border-color: #d9e6f2;
  background: linear-gradient(135deg, #eef5ff 0%, #eefaf6 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.user-list-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-list-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-list-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.user-list-profile.compact .user-list-name-row {
  gap: 8px;
  min-height: 32px;
}

.user-list-name-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-list-profile.compact .user-list-name-row strong {
  font-size: 14px;
}

.user-list-name-row .status-stack {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
}

.user-list-name-row .tag {
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
}

.user-list-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #cfe1f0;
  border-radius: 6px;
  background: var(--blue-soft);
  color: #1d5bbd;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.service-cell-link {
  margin: 0 auto;
  font-family: inherit;
  cursor: pointer;
}

.service-category-link {
  min-height: 28px;
  max-width: 100%;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-category-link:hover {
  border-color: #cfe1f0;
  background: var(--blue-soft);
  color: var(--blue);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.enhanced-table.has-sticky-action .row-actions {
  justify-content: center;
}

.user-row-actions {
  max-width: 210px;
}

.file-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.file-link {
  color: #1d5bbd;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  word-break: break-all;
}

.file-link:hover {
  text-decoration: underline;
}

.link-btn {
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d5bbd;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--blue);
}

.invoice-email-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  gap: 4px;
  overflow: hidden;
}

.invoice-email-cell > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-toolbar {
  min-height: 78px;
}

.admin-dialog.invoice-mail-account-dialog,
.admin-dialog.invoice-send-account-dialog {
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 48px));
  max-height: min(86vh, 820px);
  padding: 0;
  overflow: hidden;
}

.admin-dialog.invoice-send-account-dialog {
  width: min(720px, calc(100vw - 48px));
}

.invoice-mail-account-dialog > .admin-dialog-head,
.invoice-send-account-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.invoice-mail-account-body,
.invoice-send-account-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 8px;
  scrollbar-gutter: stable;
}

.invoice-mail-section + .invoice-mail-section {
  margin-top: 20px;
}

.invoice-mail-section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

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

.invoice-mail-table,
.invoice-send-account-table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  background: var(--panel);
  table-layout: fixed;
}

.invoice-mail-table th,
.invoice-mail-table td,
.invoice-send-account-table th,
.invoice-send-account-table td {
  height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.invoice-mail-table th,
.invoice-send-account-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
}

.invoice-mail-table tr:last-child td,
.invoice-send-account-table tr:last-child td {
  border-bottom: 0;
}

.invoice-mail-table td:first-child,
.invoice-mail-table td:nth-child(3),
.invoice-send-account-table td:nth-child(2),
.invoice-send-account-table td:nth-child(4) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-mail-table th:nth-child(1) { width: 22%; }
.invoice-mail-table th:nth-child(2) { width: 13%; }
.invoice-mail-table th:nth-child(3) { width: 20%; }
.invoice-mail-table th:nth-child(4) { width: 10%; }
.invoice-mail-table th:nth-child(5) { width: 16%; }
.invoice-mail-table th:nth-child(6) { width: 19%; }

.invoice-mail-empty {
  height: 82px !important;
  color: var(--muted) !important;
}

.invoice-mail-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.invoice-mail-row-actions .inline-btn,
.invoice-mail-row-actions .danger-btn {
  width: 62px;
  min-width: 62px;
  height: 28px;
  padding: 0 5px;
  font-size: 12px;
}

.invoice-mail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.invoice-mail-form label:not(.invoice-mail-check) {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invoice-mail-form .admin-dialog-input {
  min-height: 40px;
  height: 40px;
  margin-top: 0;
  padding: 0 12px;
  line-height: 40px;
  resize: none;
}

.invoice-mail-password-field {
  grid-column: 1 / -1;
}

.invoice-mail-check {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.invoice-mail-check input,
.invoice-send-account-table input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.invoice-mail-dialog-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.invoice-send-account-table {
  min-width: 620px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.invoice-send-account-table th:nth-child(1) { width: 64px; }
.invoice-send-account-table th:nth-child(2) { width: 32%; }
.invoice-send-account-table th:nth-child(3) { width: 18%; }
.invoice-send-account-table th:nth-child(4) { width: 29%; }
.invoice-send-account-table th:nth-child(5) { width: 12%; }

.inline-btn,
.danger-btn {
  height: 31px;
  min-width: 76px;
  padding: 0 10px;
  font-size: 12px;
  text-align: center;
}

.row-actions .inline-btn,
.row-actions .danger-btn {
  width: auto;
}

.feedback-reply-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  line-height: 1.55;
  white-space: normal;
}

.feedback-reply-text,
.feedback-reply-cell small,
.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.feedback-reply-text,
.feedback-reply-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-reply-text {
  color: var(--text);
  font-size: 13px;
}

.feedback-user-cell,
.feedback-prepay-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
  line-height: 1.45;
}

.feedback-user-cell strong,
.feedback-prepay-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-user-cell small,
.feedback-prepay-summary span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prepay-confirm-dialog {
  width: min(680px, calc(100vw - 40px));
}

.prepay-confirm-summary {
  margin-top: 2px;
}

.feedback-reply-cell.user-reply {
  color: var(--red);
  font-weight: 760;
}

.admin-dialog.feedback-process-dialog {
  display: flex;
  flex-direction: column;
  width: min(860px, calc(100vw - 48px));
  max-height: min(86vh, 800px);
  padding: 0;
  overflow: hidden;
}

.feedback-process-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.feedback-process-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.feedback-process-body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
  overflow-y: auto;
  padding: 18px 22px 8px;
  scrollbar-gutter: stable;
}

.feedback-process-section {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.feedback-process-section-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.feedback-process-info-table,
.feedback-process-history-table,
.feedback-process-reply-table {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  table-layout: fixed;
  overflow: hidden;
}

.feedback-process-info-table th,
.feedback-process-info-table td,
.feedback-process-reply-table th,
.feedback-process-reply-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.feedback-process-info-table tr:last-child th,
.feedback-process-info-table tr:last-child td,
.feedback-process-reply-table tr:last-child th,
.feedback-process-reply-table tr:last-child td {
  border-bottom: 0;
}

.feedback-process-info-table th,
.feedback-process-reply-table th {
  position: static;
  width: 104px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.feedback-process-long-text {
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feedback-process-history-wrap {
  max-height: 236px;
  overflow: auto;
  border-radius: 8px;
  scrollbar-gutter: stable;
}

.feedback-process-history-table th,
.feedback-process-history-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  vertical-align: top;
}

.feedback-process-history-table th {
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.feedback-process-history-table th:nth-child(1),
.feedback-process-history-table td:nth-child(1) {
  width: 56px;
  text-align: center;
}

.feedback-process-history-table th:nth-child(2) {
  width: auto;
}

.feedback-process-history-table th:nth-child(3),
.feedback-process-history-table td:nth-child(3) {
  width: 126px;
}

.feedback-process-history-table th:nth-child(4),
.feedback-process-history-table td:nth-child(4) {
  width: 150px;
  white-space: nowrap;
}

.feedback-process-history-table td:nth-child(2) {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.feedback-process-empty {
  height: 74px;
  color: var(--muted) !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.feedback-process-reply-table textarea {
  width: 100%;
  min-height: 142px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-sizing: border-box;
  color: var(--text);
  font: inherit;
  line-height: 1.65;
  outline: none;
  resize: vertical;
}

.feedback-process-reply-table textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.feedback-process-error {
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff1f2;
  color: #c2414a;
  font-size: 13px;
  font-weight: 750;
}

.feedback-process-form > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.return-address-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}

.return-address-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 6px;
}

.return-address-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.return-address-toggle:hover .info-more-dots,
.return-address-toggle:focus-visible .info-more-dots {
  border-color: var(--line-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.return-address-toggle:disabled {
  cursor: default;
  opacity: 0.35;
}

.return-address-text {
  overflow: hidden;
  color: var(--text);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-address-text.empty {
  color: var(--muted);
  font-weight: 760;
}

.return-address-history {
  display: grid;
  gap: 8px;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line);
}

.return-address-record {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}

.return-address-record-title {
  color: #526170;
  font-size: 12px;
  font-weight: 850;
}

.return-address-record-text {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-address-record-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.service-thumb,
.announcement-thumb {
  display: block;
  width: 78px;
  height: 54px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 54px;
  text-align: center;
}

.activity-thumb {
  display: block;
  width: 300px;
  height: 100px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  line-height: 100px;
  text-align: center;
}

.banner-thumb {
  display: block;
  width: 192px;
  height: 120px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.empty-thumb {
  border-style: dashed;
}

.carousel-system-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px;
  overflow: hidden;
  color: #ffffff;
  text-align: left;
}

.carousel-system-preview span {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-system-preview strong {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.carousel-system-light {
  border-left: 4px solid #1672d6;
  background: #ffffff;
  color: #102a43;
}

.carousel-system-blue,
.carousel-system-activity {
  border-left: 4px solid #00a88a;
  background: #1267c8;
}

.carousel-link-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.carousel-link-type {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.carousel-link-tab,
.carousel-link-page {
  border-color: #b7d8f8;
  background: #eef7ff;
  color: #1d63a8;
}

.carousel-link-service {
  border-color: #aee6d4;
  background: #ecfbf5;
  color: #087f5b;
}

.carousel-link-target {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carousel-link-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-list {
  display: grid;
}

.task-log-toolbar {
  align-items: center;
  gap: 16px;
}

.task-log-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) auto auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.task-log-filter-bar .date-range-filter {
  grid-column: auto;
}

.task-log-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
  padding: 16px;
}

.task-log-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.task-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.task-log-title-row {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.task-log-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.task-log-actor-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 58px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
}

.task-log-actor-btn {
  height: 28px;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-log-actor-btn:last-child {
  border-right: 0;
}

.task-log-actor-btn:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.task-log-actor-btn.active {
  background: var(--blue);
  color: #ffffff;
}

.task-log-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.event-list-panel,
.login-record-list {
  display: grid;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
}

.event-item {
  display: grid;
  grid-template-columns: 150px 120px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
}

.event-time,
.event-type {
  color: var(--muted);
}

.event-content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event-content strong,
.event-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-content strong {
  color: var(--text);
  font-weight: 850;
}

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

.login-record-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  background: var(--panel);
}

.login-record-item.unusual {
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}

.login-record-main,
.login-record-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.login-record-main {
  justify-content: space-between;
}

.login-record-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-record-main span,
.login-record-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.login-record-meta {
  flex-wrap: wrap;
}

.admin-feedback-list {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  overflow: hidden;
}

.admin-feedback-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: none;
  width: 100%;
  align-self: stretch;
  overflow: auto;
  scrollbar-gutter: stable;
}

.tab-panel[data-panel="adminFeedbacks"] .admin-feedback-list > .empty {
  flex: 1;
  min-height: 0;
  margin: 14px;
}

.admin-feedback-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.admin-feedback-table th,
.admin-feedback-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

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

.admin-feedback-table th {
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-feedback-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

.admin-feedback-table th:nth-child(1),
.admin-feedback-table td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.admin-feedback-table th:nth-child(2) {
  width: auto;
}

.admin-feedback-table th:nth-child(3),
.admin-feedback-table td:nth-child(3),
.admin-feedback-table th:nth-child(4),
.admin-feedback-table td:nth-child(4) {
  width: 100px;
  text-align: center;
}

.admin-feedback-table th:nth-child(5) {
  width: 160px;
}

.admin-feedback-table th:nth-child(6),
.admin-feedback-table td:nth-child(6) {
  width: 170px;
  text-align: center;
}

.admin-feedback-table th:nth-child(7),
.admin-feedback-table td:nth-child(7) {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.admin-feedback-item {
  background: var(--panel);
  transition: background-color 0.16s ease;
}

.admin-feedback-item:hover {
  background: var(--panel-soft);
}

.admin-feedback-sequence {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-feedback-title-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-feedback-title-cell strong {
  color: var(--text);
  font-weight: 850;
}

.admin-feedback-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-feedback-label {
  display: inline-flex;
  min-width: 54px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.admin-feedback-label.category-process {
  border-color: #b7d8f8;
  background: #eef7ff;
  color: #1d63a8;
}

.admin-feedback-label.category-system {
  border-color: #d0c3ff;
  background: #f5f2ff;
  color: #6549b8;
}

.admin-feedback-label.category-collaboration {
  border-color: #aee6d4;
  background: #ecfbf5;
  color: #087f5b;
}

.admin-feedback-label.category-other,
.admin-feedback-label.priority-normal {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.admin-feedback-label.priority-important {
  border-color: #f4d29c;
  background: #fff7e8;
  color: #a35b00;
}

.admin-feedback-label.priority-urgent {
  border-color: #fecaca;
  background: #fff1f2;
  color: #c2414a;
}

.admin-feedback-action-cell {
  white-space: nowrap;
  padding-inline: 10px !important;
}

.admin-feedback-view-btn {
  min-width: 56px;
}

.admin-dialog.admin-feedback-detail-dialog {
  display: flex;
  flex-direction: column;
  width: min(740px, calc(100vw - 48px));
  max-height: min(78vh, 660px);
  padding: 0;
  overflow: hidden;
}

.admin-feedback-detail-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.admin-feedback-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.admin-feedback-detail-table {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  table-layout: fixed;
  overflow: hidden;
}

.admin-feedback-detail-table th,
.admin-feedback-detail-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-feedback-detail-table tr:last-child th,
.admin-feedback-detail-table tr:last-child td {
  border-bottom: 0;
}

.admin-feedback-detail-table th {
  width: 118px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.admin-feedback-detail-table td {
  min-width: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  overflow-wrap: anywhere;
}

.admin-feedback-detail-content-row th,
.admin-feedback-detail-content-row td {
  vertical-align: top;
}

.admin-feedback-detail-content-row td {
  min-height: 148px;
  white-space: pre-wrap;
}

.admin-feedback-detail-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.admin-dialog.admin-feedback-form-dialog {
  display: flex;
  flex-direction: column;
  width: min(680px, calc(100vw - 48px));
  max-height: min(78vh, 660px);
  padding: 0;
  overflow: hidden;
}

.admin-feedback-form-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.admin-feedback-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.admin-feedback-form-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
  scrollbar-gutter: stable;
}

.admin-feedback-form-table {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  table-layout: fixed;
  overflow: hidden;
}

.admin-feedback-form-table th,
.admin-feedback-form-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin-feedback-form-table tr:last-child th,
.admin-feedback-form-table tr:last-child td {
  border-bottom: 0;
}

.admin-feedback-form-table th {
  width: 118px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  vertical-align: middle;
}

.admin-feedback-form-table td {
  min-width: 0;
  background: var(--panel);
}

.admin-feedback-form-table input,
.admin-feedback-form-table select,
.admin-feedback-form-table textarea {
  width: 100%;
  min-height: 40px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  outline: none;
}

.admin-feedback-form-table input,
.admin-feedback-form-table select {
  padding: 0 11px;
}

.admin-feedback-form-table textarea {
  min-height: 160px;
  padding: 10px 11px;
  line-height: 1.65;
  resize: vertical;
}

.admin-feedback-form-table input:focus,
.admin-feedback-form-table select:focus,
.admin-feedback-form-table textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.admin-feedback-form-error {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff1f2;
  color: #c2414a;
  font-size: 13px;
  font-weight: 750;
}

.admin-feedback-form > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.admin-dialog.test-order-create-dialog {
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100vw - 48px));
  max-height: min(86vh, 780px);
  padding: 0;
  overflow: hidden;
}

.test-order-create-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.test-order-create-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.test-order-create-body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  padding: 12px 22px 6px;
  overflow-y: auto;
  scrollbar-gutter: auto;
}

.test-order-create-section {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.test-order-create-section[hidden] {
  display: none;
}

.test-order-create-section-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.test-order-create-table-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.test-order-create-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.test-order-create-table th,
.test-order-create-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.test-order-create-table tr:last-child > th,
.test-order-create-table tr:last-child > td {
  border-bottom: 0;
}

.test-order-create-table tr > :last-child {
  border-right: 0;
}

.test-order-create-table th {
  width: 14%;
  padding: 7px 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

.test-order-create-table td {
  min-width: 0;
  padding: 4px 8px;
  background: var(--panel);
}

.test-order-create-table input,
.test-order-create-table select,
.test-order-create-table textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.test-order-create-table input,
.test-order-create-table select {
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.test-order-create-table textarea {
  min-height: 54px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}

.test-order-create-table input:focus,
.test-order-create-table select:focus,
.test-order-create-table textarea:focus {
  border-color: var(--blue);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.test-order-unit-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.test-order-unit-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.test-order-unit-field.money {
  grid-template-columns: auto minmax(0, 1fr);
}

.required-mark {
  margin-left: 3px;
  color: var(--red);
}

.test-order-create-form > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.feedback-filter {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-filter-btn {
  height: var(--button-height);
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.feedback-filter-btn.active,
.feedback-filter-btn:hover {
  border-color: #9bbff0;
  background: var(--blue-soft);
  color: #1d5bbd;
}

.test-order-page {
  display: grid;
  gap: 16px;
}

.test-order-notice-bar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 10px;
  align-items: stretch;
}

.test-order-notice-label,
.test-order-notice-message {
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 6px;
  line-height: 1.55;
}

.test-order-notice-label {
  display: grid;
  min-width: 132px;
  place-items: center;
  background: var(--blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.test-order-notice-message {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-order-notice-message strong {
  margin-right: 4px;
  font-weight: 900;
}

.test-order-notice-message.warning strong {
  color: var(--red);
}

.test-order-notice-message.info strong {
  color: var(--blue);
}

.order-multi-line-cell {
  display: grid;
  gap: 2px;
  min-width: 112px;
  text-align: left;
}

.order-multi-line-cell strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-multi-line-cell small,
.order-cell-muted {
  color: var(--muted);
  font-size: 11px;
}

.order-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}

.order-tabs .order-tab {
  flex: 0 0 auto;
}

.service-category-tabs {
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.service-category-tabs .order-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 92px;
}

.service-category-tabs .order-tab small {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.service-category-tabs .order-tab.active small,
.service-category-tabs .order-tab:hover small {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.order-tab {
  height: var(--button-height);
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.order-tab.active,
.order-tab:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.order-workbench {
  display: flex;
  flex-direction: column;
  min-height: min(660px, calc(100vh - 154px));
  overflow: hidden;
}

.order-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.order-filter-bar input,
.order-filter-bar select {
  height: var(--field-height);
  border-radius: 8px;
  font-size: 12px;
}

.date-range-filter {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.date-field {
  position: relative;
  display: block;
  margin: 0;
}

.date-field::before {
  content: attr(data-display);
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  overflow: hidden;
  max-width: calc(100% - 24px);
  color: #8b98a8;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translateY(-50%);
}

.date-field.has-value::before {
  color: var(--text);
  font-size: 13px;
}

.dashboard-info-filter .date-field.has-value::before {
  font-size: 12px;
}

.date-field input {
  height: var(--field-height);
  padding: 0 12px;
  cursor: pointer;
  color: transparent;
  caret-color: transparent;
  min-width: 0;
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 42, 62, 0.035);
}

.date-field input:focus {
  color: transparent;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.date-range-separator {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.date-picker-popover {
  position: fixed;
  z-index: 1000;
  width: 302px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 56px rgba(25, 44, 68, 0.18);
  animation: dialogIn 0.14s ease;
}

.date-picker-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-picker-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.date-picker-nav,
.date-picker-day,
.date-picker-link {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.date-picker-nav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.date-picker-nav:hover,
.date-picker-link:hover {
  border-color: #b9d3ef;
  background: var(--blue-soft);
}

.date-picker-nav:disabled,
.date-picker-day:disabled {
  cursor: not-allowed;
  color: #b8c3cc;
  background: transparent;
}

.date-picker-week,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.date-picker-week {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.date-picker-day {
  height: 34px;
  font-size: 13px;
  font-weight: 760;
}

.date-picker-day:not(:disabled):hover {
  border-color: #9bbff0;
  background: var(--blue-soft);
  color: #174ea6;
}

.date-picker-day.muted {
  color: #8a98a8;
}

.date-picker-day.today {
  border-color: rgba(7, 128, 102, 0.35);
  color: var(--green);
}

.date-picker-day.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.date-picker-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.date-picker-link {
  height: 32px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.order-filter-bar .primary-btn,
.order-filter-bar .secondary-btn {
  height: var(--field-height);
  min-width: var(--button-min-width);
  border-radius: 8px;
}

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

.order-table-wrap table[data-table-key="testOrdersTable-returnPending"],
.order-table-wrap table[data-table-key="testOrdersTable-returned"] {
  min-width: 0;
}

.order-table-wrap {
  max-height: calc(100vh - 390px);
  border-top: 1px solid var(--line);
}

.test-order-table th,
.test-order-table td {
  height: 48px;
  padding: 10px 14px;
  font-size: 12px;
  white-space: nowrap;
}

.test-order-table th:nth-child(2),
.test-order-table td:nth-child(2) {
  padding-right: 8px;
  padding-left: 8px;
}

.test-order-table th.test-order-quantity-column,
.test-order-table td.test-order-quantity-column {
  width: 64px;
  min-width: 64px;
  padding-right: 6px;
  padding-left: 6px;
  text-align: center;
}

.test-order-table th.test-order-operation-column,
.test-order-table td.test-order-operation-column {
  min-width: 320px;
}

.test-order-table th {
  background: #f3f5f7;
  color: #465566;
  font-size: 13px;
  font-weight: 900;
}

.test-order-table td {
  border-right: 1px solid var(--line);
}

.test-order-table td:nth-child(7),
.test-order-table td:nth-child(8),
.test-order-table td:nth-child(9),
.test-order-table td:nth-child(13),
.test-order-table td:nth-child(14) {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-order-table tbody tr:hover {
  background: #f7faff;
}

.test-order-table td {
  color: #51616b;
}

.order-amount-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: max-content;
}

.order-amount-value {
  color: var(--text);
  font-weight: 850;
}

.order-amount-adjust-btn {
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--blue);
  font-size: 12px;
}

.order-status-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.order-status-control:hover .tag,
.order-status-control:focus-visible .tag {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.order-status-control:focus-visible {
  outline: 0;
}

.order-status-dialog {
  width: min(480px, 100%);
}

.status-overdue-days.hidden {
  display: none;
}

.requirement-sheet-btn {
  min-width: 88px;
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.admin-dialog.requirement-sheet-dialog {
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100vw - 40px));
  max-height: min(92vh, 980px);
  padding: 0;
  overflow: hidden;
}

.requirement-sheet-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
}

.requirement-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
  background: #edf2f7;
  scrollbar-gutter: stable;
}

.requirement-sheet {
  overflow: hidden;
  border: 1px solid #aab6c4;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(26, 42, 60, 0.08);
}

.requirement-sheet-document-head {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr) 190px;
  align-items: center;
  gap: 14px;
  min-height: 94px;
  padding: 14px 22px;
  border-bottom: 1px solid #aab6c4;
}

.requirement-sheet-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.requirement-sheet-brand img {
  width: 118px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.requirement-sheet-heading {
  min-width: 0;
  text-align: center;
}

.requirement-sheet h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  color: #152238;
  font-size: 21px;
  font-weight: 900;
}

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

.requirement-sheet-date {
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.requirement-sheet-overview,
.requirement-sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.requirement-sheet-overview th,
.requirement-sheet-table th {
  width: 148px;
  padding: 8px 13px;
  border-right: 1px solid #c7d0da;
  border-bottom: 1px solid #c7d0da;
  background: #f4f6f8;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  vertical-align: middle;
}

.requirement-sheet-overview td,
.requirement-sheet-table td {
  min-width: 0;
  padding: 8px 13px;
  border-right: 1px solid #c7d0da;
  border-bottom: 1px solid #c7d0da;
  color: #172033;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: middle;
  white-space: pre-line;
  word-break: normal;
}

.requirement-sheet-overview-wide th {
  text-align: left;
  white-space: nowrap;
}

.requirement-overview-col-order-label {
  width: 108px;
}

.requirement-overview-col-order-value {
  width: 148px;
}

.requirement-overview-col-service-label {
  width: 104px;
}

.requirement-overview-col-quantity-label {
  width: 64px;
}

.requirement-overview-col-quantity-value {
  width: 58px;
}

.requirement-sheet-overview-wide tr:nth-child(2) td,
.requirement-overview-order-no,
.requirement-overview-service {
  text-align: left;
  white-space: nowrap;
}

.requirement-overview-quantity {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.requirement-sheet-overview tr > :last-child,
.requirement-sheet-table tr > :last-child {
  border-right: 0;
}

.requirement-sheet-overview tr:last-child th,
.requirement-sheet-overview tr:last-child td,
.requirement-sheet-table tr:last-child th,
.requirement-sheet-table tr:last-child td {
  border-bottom: 0;
}

.requirement-sheet-section {
  padding: 0;
}

.requirement-sheet-section + .requirement-sheet-section {
  border-top: 0;
}

.requirement-sheet-section h3 {
  margin: 0;
  padding: 10px 13px;
  border-top: 1px solid #aab6c4;
  border-bottom: 1px solid #c7d0da;
  background: #f5f7fa;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.requirement-sheet-table {
  border-top: 0;
}

.requirement-sheet-sample-table th {
  width: 13%;
  white-space: nowrap;
}

.requirement-sheet-sample-table td {
  width: 37%;
}

.requirement-sheet-sample-table th:nth-child(3) {
  width: 11%;
}

.requirement-sheet-sample-table td:nth-child(4) {
  width: 39%;
}

.requirement-sheet-remark {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  border-top: 1px solid #aab6c4;
  border-bottom: 1px solid #c7d0da;
}

.requirement-sheet-remark-label {
  padding: 8px 13px;
  border-right: 1px solid #c7d0da;
  background: #f4f6f8;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  vertical-align: middle;
}

.requirement-sheet-remark-content {
  padding: 8px 13px;
  color: #172033;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.55;
  white-space: pre-line;
}

.requirement-attachments-section {
  border-top: 0;
}

.requirement-attachments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 20px 18px;
}

.requirement-attachment-empty {
  padding: 16px 13px;
  color: #738196;
  font-size: 13px;
  line-height: 1.55;
}

.requirement-attachment-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 8px;
  border: 1px solid #c7d0da;
  border-radius: 2px;
  background: #fff;
  color: #172033;
  text-decoration: none;
}

.requirement-attachment-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
}

.requirement-attachment-card img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #f5f7fa;
}

.requirement-attachment-placeholder {
  display: grid;
  min-height: 148px;
  place-items: center;
  background: #f1f4f7;
  color: #64748b;
  font-size: 22px;
  font-weight: 900;
}

.requirement-attachment-unavailable {
  color: #738196;
  font-size: 12px;
  text-align: center;
}

.requirement-attachment-name {
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirement-sheet-foot {
  padding: 10px 20px 12px;
  border-top: 1px solid #c7d0da;
  color: #738196;
  font-size: 12px;
  line-height: 1.65;
}

.requirement-sheet-actions {
  gap: 10px;
}

.test-order-table .row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.test-order-table .row-actions .inline-btn,
.test-order-table .row-actions .danger-btn {
  width: 100%;
}

.test-order-table .test-order-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.test-order-table .test-order-actions .inline-btn,
.test-order-table .test-order-actions .danger-btn {
  min-width: 0;
  height: 30px;
  padding: 0 7px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-order-table .test-order-actions [data-action="test-order-result-files"] {
  min-width: 136px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.test-order-table th:nth-child(2),
.test-order-table td:nth-child(2) {
  min-width: 220px;
}

.order-assignee-cell {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.order-assignee-cell > span {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-assignee-cell .link-btn {
  min-height: 22px;
  font-size: 11px;
  text-align: center;
}

.order-assignment-dialog {
  width: min(520px, 100%);
}

.order-assignment-dialog .admin-dialog-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.order-assignment-dialog .order-assignment-form {
  margin-top: 0;
  padding-top: 16px;
}

.order-file-dialog,
.order-more-dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(78vh, 620px);
  padding: 0;
  overflow: hidden;
}

.order-file-dialog > .admin-dialog-head,
.order-more-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.order-file-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-gutter: stable;
}

.order-file-section + .order-file-section {
  margin-top: 18px;
}

.order-file-section-title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

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

.order-file-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: #1d5bbd;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.order-file-link:hover {
  border-color: #94b8de;
  background: var(--blue-soft);
}

.order-file-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-file-link small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.order-file-empty {
  display: grid;
  min-height: 58px;
  place-items: center;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.order-file-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.order-more-menu {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
}

.order-more-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
}

.order-more-item:hover {
  border-color: #94b8de;
  background: var(--blue-soft);
  color: #1d5bbd;
}

.order-more-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.order-no {
  color: #293f4d;
  font-weight: 850;
}

.order-no.is-urgent {
  color: #d92d20;
}

.order-no-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  margin: 0;
  gap: 5px;
  overflow: hidden;
}

.order-badges-left {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.order-no-line .order-no {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-number-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-number-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.order-number-actions .order-leader-reassign-btn,
.order-number-actions .inline-btn,
.order-number-actions .danger-btn {
  flex: 0 0 64px;
  min-width: 64px;
  width: 64px;
  height: 24px;
  padding: 0 8px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-leader-reassign-btn {
  min-width: 48px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #b9d4f5;
  border-radius: 6px;
  background: #f7fbff;
  color: #1d5fbf;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.order-leader-reassign-btn:hover,
.order-leader-reassign-btn:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: 0;
}

.return-order-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid #b9d4f5;
  border-radius: 4px;
  background: #eaf3ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.order-pause-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid #f2bf69;
  border-radius: 4px;
  background: #fff5e5;
  color: #b56708;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.order-urgent-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid #f09a93;
  border-radius: 4px;
  background: #fff0ee;
  color: #d92d20;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.order-badges-left .return-order-badge,
.order-badges-left .order-pause-badge,
.order-badges-left .order-urgent-badge {
  width: 30px;
  min-width: 30px;
  height: 22px;
}

html[data-theme="dark"] .order-pause-badge {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
}

html[data-theme="dark"] .order-urgent-badge {
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(239, 68, 68, 0.16);
  color: #ff9b9b;
}

html[data-theme="dark"] .order-no.is-urgent {
  color: #ff8f8f;
}

html[data-theme="dark"] .info-more-dots {
  background: var(--panel-soft);
}

.order-pager {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 60px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.page-size-select {
  width: 94px;
  height: 34px;
  border-radius: 8px;
  font-size: 12px;
}

.pager-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 850;
}

.pager-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pager-jump input {
  width: 54px;
  height: 34px;
  border-radius: 8px;
  text-align: center;
}

.admin-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(5px);
  animation: dialogOverlayIn 0.16s ease both;
}

.admin-dialog-overlay.closing {
  animation: dialogOverlayOut 0.12s ease both;
}

.admin-dialog {
  width: min(420px, 100%);
  max-height: min(78vh, 620px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  animation: dialogIn 0.18s ease both;
}

.admin-form-dialog {
  width: min(560px, 100%);
}

/* 管理员资料包含完整的权限矩阵，给它更舒适的横向阅读空间。 */
.admin-form-dialog.admin-permissions-dialog,
.admin-form-dialog:has(.admin-permission-field) {
  width: min(820px, 100%);
  max-height: min(84vh, 760px);
}

.agreement-editor-dialog {
  width: min(920px, 100%);
  max-height: min(88vh, 860px);
  padding: 0;
  overflow: hidden;
}

.agreement-editor-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 24px 30px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.agreement-editor-dialog > .agreement-editor-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  width: 100% !important;
  box-sizing: border-box;
  min-height: 0;
  margin-top: 0 !important;
  overflow: hidden !important;
  padding: 22px 30px 0 !important;
}

.agreement-editor-sections {
  display: grid;
  flex: 1 1 auto;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  gap: 14px;
  overflow-y: auto;
  padding: 2px 4px 18px 2px;
  scrollbar-gutter: stable;
}

.agreement-editor-section {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  box-shadow: 0 4px 14px rgba(31, 63, 92, 0.04);
}

.agreement-editor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.agreement-editor-section-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  white-space: nowrap;
}

.text-danger-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #f0c7c2;
  border-radius: 6px;
  background: #fff8f7;
  color: #c24136;
  font-size: 12px;
  font-weight: 800;
}

.text-danger-btn:hover,
.text-danger-btn:focus-visible {
  border-color: #df8f87;
  background: #fff0ee;
  color: #a92e24;
}

.agreement-editor-section textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

.agreement-editor-form > .admin-form-field:first-child {
  width: min(420px, 100%);
}

.agreement-add-section {
  align-self: flex-start;
  margin: 0 0 16px;
  border-style: dashed;
}

.agreement-editor-form > .admin-dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  flex: 0 0 auto;
  margin: 0 -30px;
  padding: 14px 30px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.agreement-editor-form > .admin-dialog-actions .secondary-btn,
.agreement-editor-form > .admin-dialog-actions .primary-btn {
  min-width: 112px;
}

@media (max-width: 560px) {
  .agreement-editor-dialog {
    max-height: 92vh;
  }

  .agreement-editor-dialog > .admin-dialog-head {
    padding: 16px 18px;
  }

  .agreement-editor-dialog > .agreement-editor-form {
    padding: 16px 18px 0;
  }

  .agreement-editor-form > .admin-dialog-actions {
    margin: 0 -18px;
    padding: 12px 18px 16px;
  }

  .agreement-editor-section {
    padding: 14px;
  }
}

.admin-wide-dialog {
  width: min(780px, 100%);
}

.admin-form-dialog:has(> .admin-form) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-form-dialog:has(> .admin-form) > .admin-dialog-head {
  flex: 0 0 auto;
}

.admin-form-dialog:has(> .admin-form) > .admin-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.activity-editor-dialog {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  max-height: min(88vh, 800px);
  padding: 0;
  overflow: hidden;
}

.activity-editor-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.activity-editor-dialog > .admin-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  gap: 0;
  margin-top: 0;
  padding-right: 0;
  overflow: hidden;
}

.activity-editor-form-body {
  display: grid;
  flex: 1 1 auto;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 22px 8px;
  scrollbar-gutter: stable;
}

.activity-editor-dialog .admin-form-section {
  gap: 10px;
  padding: 14px;
  border-color: var(--line);
  background: var(--panel);
}

.activity-editor-dialog .admin-form-section-title {
  font-size: 13px;
}

.activity-editor-dialog .admin-form-section-body {
  gap: 10px 12px;
}

.activity-editor-dialog > .admin-form > .admin-dialog-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.activity-tabs {
  flex: 0 0 auto;
  gap: 8px;
  padding: 14px 20px 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.activity-tabs .order-tab {
  min-width: 104px;
}

.activity-toolbar-actions {
  align-items: center;
}

.activity-toolbar-actions .secondary-btn.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.activity-view-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.activity-view-panel > .table-wrap {
  max-height: none;
}

.activity-draws-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.activity-draws-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.activity-draws-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.activity-draw-filter {
  display: grid;
  flex: 0 1 156px;
  min-width: 126px;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-draw-filter select,
.activity-draw-filter input {
  height: var(--field-height);
  min-width: 0;
}

.activity-draws-filter-bar {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.activity-draw-user-filter {
  flex-basis: 142px;
}

.activity-draw-date-filter {
  display: flex;
  flex: 0 1 250px;
  align-items: center;
  gap: 6px;
  min-width: 220px;
  margin: 0;
}

.activity-draw-date-filter .date-field {
  min-width: 0;
  flex: 1 1 0;
}

.activity-draw-date-filter .date-field input {
  width: 100%;
}

.activity-draws-filter-bar > button {
  flex: 0 0 auto;
  min-width: 64px;
}

.activity-draws-table-wrap {
  flex: 1 1 auto;
  min-height: 108px;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.activity-draws-table-wrap > table {
  min-width: 1120px;
}

.activity-draws-table-wrap .activity-draw-table {
  min-width: 1120px;
}

@media (max-width: 900px) {
  .activity-tabs {
    padding-right: 14px;
    padding-left: 14px;
  }

  .activity-draws-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .activity-draws-filter-bar {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .activity-draw-filter {
    flex-basis: auto;
    width: min(100%, 220px);
  }

  .activity-draw-date-filter {
    width: min(100%, 320px);
    min-width: 0;
  }

  .activity-draws-filter-bar > button {
    flex: 1 1 120px;
  }
}

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

  .activity-draw-filter,
  .activity-draw-user-filter,
  .activity-draw-date-filter {
    width: auto;
    min-width: 0;
  }

  .activity-draw-date-filter {
    grid-column: 1 / -1;
  }

  .activity-draws-filter-bar > button {
    width: 100%;
  }
}

.activity-draws-dialog {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 48px));
  max-height: min(86vh, 800px);
  padding: 0;
  overflow: hidden;
}

.activity-draws-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.activity-draws-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
  scrollbar-gutter: stable;
}

.activity-draw-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.activity-draw-summary > div {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 72px;
  gap: 4px;
  padding: 10px 14px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.activity-draw-summary > div:first-child {
  border-left: 0;
}

.activity-draw-summary span,
.activity-draws-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.activity-draw-summary strong {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.activity-draw-summary .pending strong {
  color: #a46b00;
}

.activity-draws-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
}

.activity-draws-section-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.activity-draws-section-head span {
  text-align: right;
}

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

.activity-draw-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.activity-draw-table th,
.activity-draw-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}

.activity-draw-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.activity-draw-table tr:last-child td {
  border-bottom: 0;
}

.activity-draw-table th:nth-child(1) { width: 72px; }
.activity-draw-table th:nth-child(2) { width: 150px; }
.activity-draw-table th:nth-child(3) { width: 220px; }
.activity-draw-table th:nth-child(4) { width: 220px; }
.activity-draw-table th:nth-child(5) { width: 160px; }
.activity-draw-table th:nth-child(6) { width: 100px; }
.activity-draw-table th:nth-child(7) { width: 260px; }

.activity-draw-user,
.activity-draw-prize {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
}

.activity-draw-user-profile {
  width: 100%;
  padding: 2px 0;
}

.activity-draw-user-profile .user-list-name-row {
  min-height: 32px;
}

.activity-draw-avatar,
.activity-draw-prize-image {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.activity-draw-prize-image {
  border-radius: 6px;
}

.activity-draw-avatar img,
.activity-draw-prize-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-draw-user > span:last-child,
.activity-draw-prize > span:last-child,
.activity-draw-delivery,
.activity-draw-logistics-cell {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.activity-draw-user strong,
.activity-draw-prize strong,
.activity-draw-delivery strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-draw-user small,
.activity-draw-prize small,
.activity-draw-delivery small,
.activity-draw-delivery span,
.activity-draw-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.activity-draw-delivery {
  text-align: left;
}

.activity-draw-delivery span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.activity-draw-nickname,
.activity-draw-logistics-summary {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-draw-logistics-cell {
  justify-items: start;
  text-align: left;
}

.activity-draw-logistics-cell small,
.activity-draw-delivery small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-draw-logistics-cell .inline-btn {
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-draw-empty {
  display: inline-block;
  padding: 4px 0;
}

.activity-draw-table-empty {
  height: 124px;
  color: var(--muted) !important;
}

.activity-draws-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.activity-draw-logistics-dialog {
  width: min(680px, calc(100vw - 40px));
}

.activity-draw-delivery-summary {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.activity-draw-delivery-summary span,
.activity-draw-delivery-summary small {
  color: var(--muted);
  font-size: 12px;
}

.activity-draw-delivery-summary strong {
  color: var(--text);
  font-size: 13px;
}

.activity-target-user-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.activity-target-user {
  display: flex;
  align-items: center;
  min-width: 156px;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.activity-target-user.unresolved {
  border-color: rgba(200, 62, 62, 0.3);
  background: var(--red-soft);
}

.activity-target-user-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.activity-target-user-avatar img,
.activity-target-user-avatar span {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-target-user-avatar span {
  display: grid;
  place-items: center;
}

.activity-target-user > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.activity-target-user strong,
.activity-target-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-target-user strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.activity-target-user small,
.activity-target-user-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.activity-target-user-empty {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 3px;
}

.service-editor-dialog {
  display: flex;
  flex-direction: column;
  width: min(1880px, calc(100vw - 36px));
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
}

.service-editor-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.admin-form-dialog.service-editor-dialog > .admin-form.admin-form-sections {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 0;
  margin-top: 0;
  overflow: hidden;
  padding-right: 0;
}

.service-editor-form-body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  padding: 16px 22px;
}

.service-editor-layout {
  display: grid;
  grid-template-columns: minmax(238px, 0.78fr) minmax(420px, 1.52fr) minmax(390px, 1.3fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.service-editor-layout.service-flow-collapsed {
  grid-template-columns: minmax(238px, 0.78fr) minmax(420px, 1.52fr) 44px;
}

.service-editor-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.service-editor-dialog .admin-form-section {
  gap: 12px;
  padding: 14px;
  border-color: var(--line);
  background: var(--panel);
}

.service-editor-dialog .admin-form-section-title {
  font-size: 13px;
}

.service-editor-dialog .service-flow-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.service-editor-dialog .service-flow-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.service-editor-dialog .service-flow-section.is-collapsed {
  align-items: stretch;
  padding: 10px 6px;
  background: var(--panel-soft);
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-section-title {
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-title-text {
  max-height: 170px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  writing-mode: vertical-rl;
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-editor,
.service-editor-dialog .service-flow-section.is-collapsed .service-flow-help {
  display: none;
}

.service-editor-dialog .service-flow-editor {
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  align-items: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.service-editor-dialog .service-flow-step:last-child {
  grid-column: 1 / -1;
}

.service-editor-dialog .service-flow-step {
  gap: 10px;
  padding: 12px;
  background: var(--panel-soft);
}

.service-flow-toggle {
  display: inline-grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.service-flow-toggle:hover,
.service-flow-toggle:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  outline: none;
}

.service-editor-dialog .service-flow-section.is-collapsed .service-flow-toggle {
  flex: 0 0 30px;
}

.service-category-dialog {
  display: flex;
  flex-direction: column;
  width: min(820px, calc(100vw - 36px));
  max-height: min(86vh, 760px);
  padding: 0;
  overflow: hidden;
}

.service-category-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.service-category-dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.service-category-dialog-toolbar > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.service-category-dialog-toolbar .secondary-btn {
  flex: 0 0 auto;
  min-width: 92px;
}

.admin-form.service-category-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  gap: 0;
  margin: 0;
  overflow: hidden;
  padding: 16px 24px 0;
  width: 100%;
  box-sizing: border-box;
}

.service-category-table {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.service-category-table-head,
.service-category-row {
  display: grid;
  grid-template-columns: 108px minmax(180px, 1fr) 164px 92px;
  align-items: center;
}

.service-category-table-head {
  flex: 0 0 auto;
  min-height: 42px;
  box-sizing: border-box;
  padding-right: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.service-category-table-head > span:not(:last-child),
.service-category-row > *:not(:last-child) {
  border-right: 1px solid var(--line);
}

.service-category-rows {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.service-category-row {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

.service-category-row > input,
.service-category-row > button {
  min-width: 0;
  margin: 0 10px;
}

.service-category-row > input {
  width: auto;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

.service-category-row > input[name="name"] {
  text-align: left;
}

.service-category-icon-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 25px 16px;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
  margin: 0 10px;
}

.service-category-icon-preview {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--panel-soft);
}

.service-category-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-width: 68px;
  height: 25px;
  padding: 0 8px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.service-category-icon-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.service-category-icon-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.service-category-icon-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-category-row > input:hover {
  border-color: var(--line-strong);
}

.service-category-row > input:focus {
  position: relative;
  z-index: 1;
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.service-category-row > .danger-btn {
  justify-self: center;
  width: 64px;
  min-width: 64px;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.service-category-form > .admin-dialog-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 72px;
  margin: 16px -24px 0;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.service-category-form > .admin-dialog-actions .secondary-btn,
.service-category-form > .admin-dialog-actions .primary-btn {
  min-width: 92px;
}

@media (max-width: 680px) {
  .service-category-table-head,
  .service-category-row {
    grid-template-columns: 76px minmax(120px, 1fr) 132px 72px;
  }

  .service-category-icon-control {
    margin: 0 6px;
  }

  .service-category-row > input,
  .service-category-row > button {
    margin-right: 6px;
    margin-left: 6px;
  }
}

.service-editor-dialog .service-flow-step-head {
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
  align-items: center;
}

.service-editor-dialog .service-flow-step-title {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
}

.service-editor-dialog .service-flow-step-title span {
  height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

.service-editor-dialog .service-flow-step-title input,
.service-editor-dialog .service-flow-step-head .mini-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.service-editor-dialog .service-flow-help {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 9px 12px;
  border-left: 3px solid var(--green);
  background: var(--panel-soft);
  font-size: 12px;
  line-height: 1.55;
}

.service-editor-dialog > .admin-form > .admin-dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  align-self: stretch;
  flex: 0 0 auto;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  margin: 0;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -8px 22px rgba(24, 42, 62, 0.05);
}

.service-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.service-basic-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.service-basic-field > span {
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.service-basic-field > input,
.service-basic-field > select,
.service-basic-field > textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  background: var(--panel);
}

.service-editor-dialog .service-basic-field > input,
.service-editor-dialog .service-basic-field > select {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.service-basic-field > textarea {
  min-height: 58px;
  resize: vertical;
}

.service-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.service-profile-grid textarea {
  min-height: 66px;
}

.service-profile-cell,
.service-price-cell {
  display: grid;
  min-width: 0;
  gap: 4px;
  line-height: 1.35;
}

.service-profile-cell > span,
.service-price-cell > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-profile-cell > small,
.service-price-cell > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-edit-table-wrap,
.service-flow-table-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.service-editor-dialog .service-flow-table-wrap {
  max-height: 326px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.service-editor-dialog .service-flow-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.service-editor-side::-webkit-scrollbar,
.service-editor-dialog .service-flow-editor::-webkit-scrollbar,
.service-editor-dialog .service-flow-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.service-editor-side::-webkit-scrollbar-thumb,
.service-editor-dialog .service-flow-editor::-webkit-scrollbar-thumb,
.service-editor-dialog .service-flow-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #bdcad7;
  background-clip: content-box;
}

.service-editor-side::-webkit-scrollbar-track,
.service-editor-dialog .service-flow-editor::-webkit-scrollbar-track,
.service-editor-dialog .service-flow-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.service-edit-table,
.service-flow-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.service-edit-table th,
.service-edit-table td,
.service-flow-table th,
.service-flow-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.service-edit-table tr:last-child > th,
.service-edit-table tr:last-child > td,
.service-flow-table tbody > tr:last-child > td {
  border-bottom: 0;
}

.service-edit-table tr > :last-child,
.service-flow-table tr > :last-child {
  border-right: 0;
}

.service-edit-table th {
  width: 14%;
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

.service-edit-table td {
  padding: 8px 10px;
}

.service-edit-table input,
.service-edit-table select,
.service-edit-table textarea,
.service-flow-table input,
.service-flow-table select {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.service-edit-table textarea {
  min-height: 72px;
  resize: vertical;
}

.service-edit-table input:focus,
.service-edit-table select:focus,
.service-edit-table textarea:focus,
.service-flow-table input:focus,
.service-flow-table select:focus {
  border-color: var(--blue);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.service-media-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.service-media-image-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 128px;
}

.service-media-label,
.service-media-field > span {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 0;
  padding: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.service-media-label {
  border-right: 1px solid var(--line);
}

.service-media-image-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 12px;
}

.service-editor-dialog .service-media-image-cell .service-form-image {
  width: min(228px, 100%);
  height: auto;
  aspect-ratio: 3 / 2;
}

.service-media-setting-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.service-media-field {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-width: 0;
  margin: 0;
}

.service-media-field + .service-media-field {
  border-left: 1px solid var(--line);
}

.service-media-field > span {
  border-right: 1px solid var(--line);
}

.service-media-field > input,
.service-media-field > select {
  width: 100%;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  text-align-last: center;
  box-shadow: none;
}

.service-media-field > input:focus,
.service-media-field > select:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.service-flow-table { min-width: 0; }

.service-flow-table th {
  padding: 7px 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.service-flow-table th:nth-child(1) { width: 38px; }
.service-flow-table th:nth-child(2) { width: 40%; }
.service-flow-table th:nth-child(3) { width: 92px; }
.service-flow-table th:nth-child(4) { width: 54px; }
.service-flow-table th:nth-child(5) { width: 46px; }
.service-flow-table th:nth-child(6) { width: 122px; }

.service-flow-table th:nth-child(3),
.service-flow-table td:nth-child(3) {
  text-align: center;
}

.service-flow-type-select {
  color: var(--text);
  font-weight: 760;
  text-align-last: center;
}

.service-flow-row td {
  padding: 3px 6px;
  background: var(--panel);
}

.service-flow-row input,
.service-flow-row select {
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  font-size: 11px;
}

.service-flow-index,
.service-flow-check-cell {
  text-align: center;
}

.service-flow-index {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.service-flow-check-cell input {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.service-flow-row-actions {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.service-flow-row-actions .mini-btn {
  width: 48px;
  min-width: 48px;
  height: 28px;
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  vertical-align: middle;
}

.service-flow-row-actions .mini-btn + .mini-btn {
  margin-left: 6px;
}

.service-flow-detail-row > td {
  padding: 0;
  background: var(--panel);
}

.service-flow-detail-row[hidden] {
  display: none;
}

.service-flow-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 9px;
  background: var(--panel);
}

.service-flow-detail-grid .admin-form-field {
  gap: 5px;
}

.service-flow-detail-grid .admin-form-field span {
  font-size: 12px;
}

.service-flow-detail-grid .admin-form-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.service-flow-detail-grid .admin-form-field > input,
.service-flow-detail-grid .admin-form-field > select,
.service-flow-detail-grid .admin-form-field > textarea {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  box-shadow: none;
  font-size: 12px;
}

.service-flow-detail-grid .admin-form-field > input,
.service-flow-detail-grid .admin-form-field > select {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
}

.service-flow-detail-grid .admin-form-field > textarea {
  min-height: 64px;
  padding: 8px 10px;
}

.service-flow-detail-grid .admin-form-field > input:hover,
.service-flow-detail-grid .admin-form-field > select:hover,
.service-flow-detail-grid .admin-form-field > textarea:hover {
  border-color: var(--line-strong);
}

.service-flow-detail-grid .admin-form-field > input:focus,
.service-flow-detail-grid .admin-form-field > select:focus,
.service-flow-detail-grid .admin-form-field > textarea:focus {
  border-color: var(--blue);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.service-flow-rule {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.service-flow-rule strong,
.service-flow-rule span {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
}

.service-flow-rule strong {
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 850;
  justify-content: center;
  white-space: nowrap;
}

.service-flow-rule span {
  color: var(--muted);
}

.service-flow-required-detail {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.service-flow-detail-grid textarea {
  min-height: 48px;
  resize: vertical;
}

.service-flow-allow-text {
  grid-column: 1 / -1;
  font-size: 12px;
}

.service-option-editor {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.service-option-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.service-option-editor-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.service-option-editor-head strong {
  color: var(--text);
  font-size: 12px;
}

.service-option-editor-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-option-editor-head .mini-btn {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
}

.service-option-table-head,
.service-option-row {
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) 72px 58px;
  align-items: center;
}

.service-option-table-head {
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.service-option-table-head > span,
.service-option-row > * {
  min-width: 0;
}

.service-option-table-head > span:not(:last-child),
.service-option-row > *:not(:last-child) {
  border-right: 1px solid var(--line);
}

.service-option-row {
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

.service-option-index {
  align-self: stretch;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.service-option-row input {
  width: 100%;
  height: 35px;
  min-width: 0;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
  font-size: 11px;
}

.service-option-row input:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.service-option-row .mini-btn {
  justify-self: center;
  width: 46px;
  min-width: 46px;
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  font-size: 10px;
}

.service-flow-empty {
  padding: 18px !important;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.order-detail-dialog {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  max-height: min(86vh, 760px);
  padding: 0;
  overflow: hidden;
}

.order-detail-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.order-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
  scrollbar-gutter: stable;
}

.order-detail-section {
  margin-bottom: 18px;
}

.order-detail-section:last-child {
  margin-bottom: 0;
}

.order-detail-section-title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.order-detail-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.order-detail-row:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.order-detail-row:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.order-detail-label,
.order-detail-value {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.5;
}

.order-detail-label {
  justify-content: center;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.order-detail-value {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.order-detail-table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: collapse;
}

.order-detail-table th,
.order-detail-table td {
  padding: 10px 11px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

.order-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.order-detail-table th {
  position: static;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.order-detail-table td {
  color: var(--text);
  font-weight: 650;
}

.order-detail-table th:nth-child(1),
.order-detail-table td:nth-child(1) {
  width: 145px;
}

.order-detail-table th:nth-child(2),
.order-detail-table td:nth-child(2) {
  width: 104px;
}

.order-detail-table th:nth-child(3),
.order-detail-table td:nth-child(3) {
  width: 118px;
}

.order-detail-table th:nth-child(4),
.order-detail-table td:nth-child(4) {
  width: 112px;
}

.order-timeline-table {
  min-width: 0;
  table-layout: auto;
}

.order-timeline-table th:first-child,
.order-timeline-table td:first-child {
  width: 170px;
  white-space: nowrap;
}

.order-detail-positive {
  color: var(--green) !important;
  font-weight: 850 !important;
}

.order-detail-negative {
  color: var(--red) !important;
  font-weight: 850 !important;
}

.order-detail-empty-cell {
  color: var(--muted) !important;
  text-align: center !important;
  font-weight: 650 !important;
}

.order-detail-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 13px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.order-detail-footer .primary-btn {
  min-width: 92px;
}

.admin-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-dialog-title-group {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.admin-dialog-desc {
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.5;
}

.user-detail-dialog {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(84vh, 760px);
  padding: 0;
  overflow: hidden;
}

.user-detail-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.user-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.user-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.user-edit-dialog {
  width: min(820px, 100%);
  max-height: min(88vh, 820px);
  padding: 0;
}

.user-create-dialog {
  width: min(680px, 100%);
  max-height: min(82vh, 680px);
  padding: 0;
}

.user-create-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.user-create-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 18px 22px 20px;
}

.user-create-form .admin-dialog-actions {
  margin-top: 2px;
}

.user-edit-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.user-edit-dialog > .user-edit-form {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 16px 22px 18px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.user-edit-dialog .admin-form-section {
  gap: 10px;
}

.user-edit-dialog .admin-form-section-body {
  gap: 12px 16px;
}

.user-detail-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f3ff 0%, #e8f7f3 100%);
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.user-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-detail-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.user-detail-name-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.user-detail-name-row .admin-dialog-title {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-detail-name-row .status-stack {
  flex: 0 0 auto;
  justify-content: flex-start;
}

.user-detail-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-close-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-close-btn:hover {
  border-color: var(--line-strong);
  color: var(--blue);
}

.user-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px 0;
}

.user-wallet-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.user-wallet-card span,
.user-wallet-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-wallet-card strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
}

.user-wallet-card.negative {
  border-color: rgba(200, 62, 62, 0.28);
  background: var(--red-soft);
}

.balance-negative,
.balance-current-value.negative,
.balance-record-item .text-danger {
  color: var(--red);
  font-weight: 900;
}

.balance-current-value {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.balance-current-field {
  margin-bottom: 2px;
}

.order-amount-adjust-form input[name="amount"] {
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  text-align: center;
}

.order-amount-adjust-form input[name="amount"]::placeholder {
  color: var(--muted);
  opacity: 1;
  text-align: center;
}

.balance-record-dialog {
  margin-top: 18px;
}

.balance-record-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.balance-record-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.balance-record-item small {
  grid-column: 1 / -1;
}

.user-detail-section {
  margin: 18px 24px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-detail-section:last-child {
  margin-bottom: 24px;
}

.user-detail-section-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.realname-state-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.realname-state-card.unverified {
  border-color: rgba(200, 62, 62, 0.24);
  background: var(--red-soft);
}

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

.user-detail-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.user-detail-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-detail-field strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-address-current {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.user-address-current span,
.user-address-current small,
.user-detail-mini-item small,
.user-record-item small {
  color: var(--muted);
  font-size: 12px;
}

.user-address-current strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.user-detail-mini-list,
.user-record-list {
  display: grid;
  gap: 8px;
}

.user-address-current + .user-detail-mini-list {
  margin-top: 10px;
}

.user-detail-mini-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-detail-mini-item strong,
.user-record-item strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.user-detail-mini-item span,
.user-record-item span {
  color: #4b5b68;
  font-size: 13px;
  line-height: 1.45;
}

.user-record-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(96px, 0.55fr) minmax(86px, 0.45fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.user-record-item > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-record-item > div:first-child strong,
.user-record-item > div:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-detail-empty {
  display: grid;
  min-height: 62px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-dialog-overlay.closing .admin-dialog {
  animation: dialogOut 0.12s ease both;
}

.admin-dialog-title {
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.admin-dialog-message {
  margin-top: 10px;
  color: #4b5b68;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.admin-dialog-input {
  width: 100%;
  min-height: 110px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  outline: none;
  resize: vertical;
}

.admin-dialog-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
  margin-top: 18px;
}

/* 表单内所有整行模块（含权限设置）都必须跨越两列。 */
.admin-form > .full-span {
  grid-column: 1 / -1;
}

.admin-form.admin-form-sections {
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-form-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.85), rgba(255, 255, 255, 0.96));
}

.admin-form-section-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.admin-form-section-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.admin-form-section-body .full-span {
  grid-column: 1 / -1;
}

.admin-form-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.media-section-body {
  align-items: start;
}

.service-flow-editor {
  display: grid;
  gap: 14px;
}

.service-flow-step {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.service-flow-step-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  gap: 12px;
  align-items: end;
}

.service-flow-step-title {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.service-flow-step-title span {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.service-step-price {
  display: grid;
  gap: 6px;
}

.service-step-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.service-flow-fields {
  display: grid;
  gap: 10px;
}

.service-flow-field {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #cbd8e6;
  border-radius: 8px;
  background: var(--panel-soft);
}

.service-flow-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-flow-field-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

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

.service-flow-grid .full-span,
.service-flow-checks.full-span {
  grid-column: 1 / -1;
}

.service-flow-checks {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.flow-text-placeholder {
  min-width: 0;
}

.mini-btn {
  min-width: 74px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.service-flow-help {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-form-field {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  margin-top: 0;
}

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

.admin-avatar-field {
  justify-items: start;
}

.admin-form-field span {
  color: #344454;
  font-size: 13px;
  font-weight: 850;
}

.admin-form-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-permission-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-service-scope-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-service-scope-head {
  display: grid;
  gap: 3px;
}

.admin-service-scope-head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.admin-service-scope-head small,
.admin-service-scope-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.admin-service-scope-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.admin-service-scope-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.admin-service-scope-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 42px;
}

.admin-service-scope-parent,
.admin-service-scope-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  cursor: pointer;
}

.admin-service-scope-parent {
  min-height: 42px;
  margin: 0;
  padding: 7px 10px;
}

.admin-service-scope-parent span,
.admin-service-scope-child span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.admin-service-scope-parent strong,
.admin-service-scope-child strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.admin-service-scope-parent small,
.admin-service-scope-child small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-service-scope-parent > input[type="checkbox"],
.admin-service-scope-child > input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.admin-service-scope-toggle {
  position: relative;
  width: 34px;
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--muted);
  font-size: 0;
  line-height: 1;
  transition: background-color 0.16s ease;
}

.admin-service-scope-toggle::before {
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  transition: transform 0.16s ease;
}

.admin-service-scope-toggle:hover,
.admin-service-scope-toggle:focus-visible {
  background: var(--panel);
  color: var(--text);
  outline: 0;
}

.admin-service-scope-toggle[aria-expanded="true"] {
  color: var(--text);
}

.admin-service-scope-toggle[aria-expanded="true"]::before {
  transform: rotate(180deg);
}

.admin-service-scope-children {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px 10px 34px;
}

.admin-service-scope-children[hidden] {
  display: none;
}

.admin-service-scope-child {
  min-height: 34px;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.admin-service-scope-child:has(input:checked) {
  border-color: #a9c9ee;
  background: var(--blue-soft);
}

.admin-service-scope-group.has-parent-scope .admin-service-scope-children {
  opacity: 0.55;
}

.admin-default-project-field.is-hidden {
  display: none;
}

.admin-default-project-panel {
  min-height: 182px;
}

.admin-default-project-panel .admin-service-scope-list {
  grid-template-columns: 1fr;
}

@media (max-width: 760px) {
  .admin-service-scope-list {
    grid-template-columns: 1fr;
  }
}

.admin-permission-panel-intro {
  display: none;
}

.admin-permission-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(156px, 208px));
  gap: 8px;
}

.admin-permission-mode-row label,
.admin-permission-option {
  cursor: pointer;
}

.admin-permission-mode-option {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 36px;
  margin-top: 0;
  gap: 9px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.admin-permission-mode-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.5);
  background: var(--blue-soft);
}

.admin-permission-mode-option input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.admin-permission-mode-option > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.admin-permission-scope {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid #d9e4f1;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--panel-soft);
}

.admin-permission-scope-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-permission-scope-head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.admin-permission-scope-head small,
.admin-permission-scope-actions {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.admin-permission-scope-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-permission-scope-pages span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #cadbee;
  border-radius: 5px;
  background: var(--panel);
  color: #245c9f;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 7px;
}

.admin-permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  margin-top: 0;
  padding: 8px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.admin-permission-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.48);
  background: var(--blue-soft);
}

.admin-permission-option input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.admin-permission-option > span {
  display: block;
  min-width: 0;
}

.admin-permission-option strong {
  color: var(--text);
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-permission-option small,
.admin-permission-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.admin-permission-option small {
  display: none;
}

.admin-permission-option:has(input:disabled) {
  cursor: default;
  opacity: 0.68;
}

.admin-permission-option:has(input:disabled):has(input:checked) {
  opacity: 0.82;
}

.admin-permission-summary {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.admin-permission-summary small {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-form-field > input,
.admin-form-field > select,
.admin-form-field > textarea {
  width: 100%;
  min-width: 0;
}

.password-confirm-control {
  position: relative;
  min-width: 0;
}

.password-confirm-control > input {
  width: 100%;
  min-width: 0;
  padding-right: 42px;
}

.password-match-indicator {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.8);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.password-match-indicator.is-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.password-match-indicator.is-match {
  background: #159b6b;
}

.password-match-indicator.is-mismatch {
  background: #d14343;
}

.admin-form input:disabled,
.admin-form select:disabled {
  background: #f2f5f8;
  color: #7c8895;
  cursor: not-allowed;
}

.service-form-image,
.form-image-preview {
  display: grid;
  place-items: center;
  width: 120px;
  height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.image-dropzone {
  cursor: pointer;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.image-dropzone:hover,
.image-dropzone:focus-visible,
.image-dropzone.drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.image-dropzone.drag-over {
  transform: translateY(-1px);
}

.form-image-preview.banner-preview {
  width: min(288px, 100%);
  height: auto;
  aspect-ratio: 8 / 5;
}

.form-image-preview.activity-preview {
  width: min(480px, 100%);
  height: auto;
  aspect-ratio: 3 / 1;
  background: #ffffff;
}

.form-image-preview.activity-preview img {
  object-fit: contain;
}

.activity-lottery-config {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

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

.activity-lottery-heading {
  min-width: 0;
}

.activity-lottery-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: end;
  gap: 10px;
}

.activity-lottery-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.activity-lottery-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.activity-lottery-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.activity-lottery-preview-disk {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 116px;
  height: 116px;
  border: 7px solid #ffffff;
  border-radius: 50%;
  background: conic-gradient(#0b63ce 0 16.6%, #078066 16.6% 33.2%, #27a8d8 33.2% 49.8%, #1556a8 49.8% 66.4%, #16a39b 66.4% 83%, #3a8bd8 83% 100%);
  box-shadow: 0 0 0 2px #dceef4, 0 8px 18px rgba(12, 48, 82, 0.16);
}

.activity-lottery-preview-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-left: 8px solid transparent;
  border-top: 20px solid var(--green);
  transform: translateX(-50%);
}

.activity-lottery-preview-core {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px solid var(--green);
  border-radius: 50%;
  background: #ffffff;
  color: var(--blue);
  font-size: 8px;
  font-weight: 900;
}

.activity-lottery-preview-core img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.activity-lottery-preview-boxes {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 46px);
  gap: 7px;
  padding: 10px;
  border: 1px solid #b8d8e9;
  border-radius: 12px;
  background: #e3f3fa;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.52);
}

.activity-lottery-preview-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 10px;
  background: linear-gradient(145deg, #35a6db 0%, #0b63ce 100%);
  color: #ffffff;
  box-shadow: inset 0 -5px 0 rgba(5, 72, 150, 0.2), 0 4px 7px rgba(8, 83, 143, 0.18);
}

.activity-lottery-preview-box::before,
.activity-lottery-preview-box b {
  position: absolute;
  content: "";
}

.activity-lottery-preview-box::before {
  top: -18px;
  left: 6px;
  width: 18px;
  height: 78px;
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(32deg);
}

.activity-lottery-preview-box b {
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f6c95f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.activity-lottery-preview-box i {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.activity-lottery-preview-box:nth-child(2n) {
  background: linear-gradient(145deg, #18a990 0%, #078066 100%);
}

.activity-lottery-preview-box:nth-child(3n) {
  background: linear-gradient(145deg, #5a9ee3 0%, #1556a8 100%);
}

.activity-lottery-preview-box.is-brand {
  border-color: #f5d987;
  background: linear-gradient(145deg, #f3b531 0%, #e5831c 100%);
  box-shadow: inset 0 -5px 0 rgba(162, 83, 5, 0.22), 0 4px 8px rgba(176, 100, 11, 0.25);
}

.activity-lottery-preview-box.is-brand i {
  font-size: 10px;
}

.activity-lottery-preview strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.activity-lottery-preview p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.lottery-count-field {
  width: 96px;
  flex: 0 0 96px;
}

.lottery-count-field > input,
.activity-lottery-add.inline-btn {
  height: 34px;
  min-height: 34px;
}

.activity-lottery-add {
  min-width: 94px;
}

.activity-lottery-rows {
  display: grid;
  gap: 12px;
}

.activity-lottery-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 112px;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.activity-prize-panel {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.activity-prize-core {
  display: grid;
  grid-template-columns: minmax(120px, 1.45fr) minmax(72px, 0.8fr) minmax(100px, 1fr) minmax(66px, 0.55fr) minmax(105px, 1fr);
  gap: 12px;
}

.activity-prize-image-field {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 6px;
  min-height: 100%;
  padding: 9px 8px;
  border: 1px solid #d9e8f0;
  border-radius: 8px;
  background: #f7fbfd;
}

.activity-prize-image-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.activity-prize-image {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.activity-prize-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.activity-prize-image-field small {
  max-width: 112px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.activity-prize-conditions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 11px 12px 12px;
  border: 1px solid #dce9ef;
  border-radius: 8px;
  background: #f8fbfc;
}

.activity-prize-conditions-title {
  grid-column: 1 / -1;
  color: #5b7281;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.activity-shipping-notice {
  margin-top: 2px;
}

/* Blindbox rule engine: mirrors the mini-program's ice-blue reward station. */
.blindbox-rule-editor {
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  padding: 18px;
  border: 1px solid #bcd9fb;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fcff 0%, #e6f3ff 100%);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.62), 0 10px 22px rgba(31, 100, 184, 0.08);
}

.blindbox-rule-editor::before {
  position: absolute;
  top: -90px;
  right: -58px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(52, 135, 233, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(87, 163, 245, 0.06);
  content: "";
}

.blindbox-rule-editor-head,
.blindbox-rule-editor .admin-form-field,
.blindbox-rule-preview {
  position: relative;
  z-index: 1;
}

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

.blindbox-rule-editor-kicker {
  color: #2b78d5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.blindbox-rule-editor-title {
  margin-top: 5px;
  color: #154f9a;
  font-size: 16px;
  font-weight: 900;
}

.blindbox-rule-editor-desc {
  max-width: 680px;
  margin-top: 5px;
  color: #6684a4;
  font-size: 12px;
  line-height: 1.6;
}

.blindbox-rule-editor-orb {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d5ebff;
  border-radius: 13px;
  background: linear-gradient(145deg, #5daaff, #176ed3);
  box-shadow: 0 7px 14px rgba(19, 103, 205, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.blindbox-rule-editor textarea {
  min-height: 148px;
  border-color: #bfdaf7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 2px rgba(22, 88, 166, 0.04);
}

.blindbox-rule-preview {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #d4e7fa;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.blindbox-rule-preview > span {
  display: inline-flex;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e5f2ff;
  color: #2670cb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  line-height: 22px;
}

.blindbox-rule-preview p {
  margin: 9px 0 0;
  color: #4f6d8d;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.activity-lottery-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 620px) {
  .activity-lottery-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .activity-lottery-tools {
    justify-content: flex-end;
  }

  .activity-lottery-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .activity-prize-panel,
  .activity-prize-image-field {
    grid-column: 2 / 3;
  }

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

  .activity-prize-image-field {
    grid-template-columns: auto 88px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 8px;
  }

  .activity-prize-image-label {
    grid-column: 1;
  }

  .activity-prize-image-field .activity-prize-image {
    grid-column: 2;
  }

  .activity-prize-image-field small {
    grid-column: 3;
    max-width: none;
    text-align: left;
  }

  .activity-prize-conditions {
    grid-template-columns: 1fr;
  }

  .activity-draws-dialog {
    width: min(100%, calc(100vw - 20px));
  }

  .activity-draws-dialog > .admin-dialog-head,
  .activity-draws-body,
  .activity-draws-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .activity-draws-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .activity-draws-section-head span {
    text-align: left;
  }

  .activity-draw-summary > div {
    min-height: 64px;
    padding: 9px 6px;
  }

  .activity-draw-summary strong {
    font-size: 18px;
  }
}

.admin-form-field.compact {
  gap: 5px;
}

.form-image-preview.admin-avatar-preview {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8f3ff 0%, #e8f7f3 100%);
}

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

.service-form-empty,
.form-image-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-pick-note {
  max-width: 220px;
}

.form-image-preview.return-photo-preview {
  width: 156px;
  height: 117px;
}

.image-crop-dialog {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(86vh, 720px);
  padding: 0;
  overflow: hidden;
}

.image-crop-dialog > .admin-dialog-head {
  flex: 0 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.image-crop-body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 16px;
  padding: 20px 22px 12px;
  overflow-y: auto;
}

.image-crop-stage {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: var(--crop-ratio);
  justify-self: center;
  overflow: hidden;
  border: 1px solid #27384a;
  border-radius: 6px;
  background: #101923;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.image-crop-stage:active {
  cursor: grabbing;
}

.image-crop-source {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: width, height, left, top, transform;
}

.image-crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.38) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, 0.38) 1px, transparent 1px);
  background-size: 33.333% 100%, 100% 33.333%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), inset 0 0 40px rgba(0, 0, 0, 0.2);
}

.image-crop-zoom {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-crop-toolbar {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.image-crop-toolbar-divider {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}

.image-crop-tool {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.image-crop-tool:hover,
.image-crop-tool:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  outline: 0;
}

.image-crop-zoom input {
  width: 100%;
  accent-color: var(--blue);
}

.image-crop-zoom output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.image-crop-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.checkbox-field {
  align-content: start;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.theme-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.theme-mode-option {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 850;
}

.theme-mode-option.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.admin-form input[type="color"] {
  height: 42px;
  padding: 4px;
}

.admin-form .admin-dialog-actions {
  grid-column: 1 / -1;
}

.admin-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

html[data-theme="dark"] .server-status-progress {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
  .server-status-card {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .server-status-card.is-expanded {
    max-height: 188px;
  }

  .server-status-card.is-expanded .server-status-body {
    max-height: 128px;
  }
}

@keyframes dialogOverlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dialogOverlayOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dialogOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

html[data-theme="dark"] .brand-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] .login-system-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-title-text,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .admin-dialog-title {
  color: var(--text);
}

html[data-theme="dark"] .server-box,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .workbench-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .task-log-card,
html[data-theme="dark"] .user-detail-head,
html[data-theme="dark"] .user-detail-section,
html[data-theme="dark"] .user-detail-mini-item,
html[data-theme="dark"] .user-record-item,
html[data-theme="dark"] .realname-state-card,
html[data-theme="dark"] .icon-close-btn,
html[data-theme="dark"] .card-toolbar,
html[data-theme="dark"] .admin-menu,
html[data-theme="dark"] .theme-btn,
html[data-theme="dark"] .secondary-btn,
html[data-theme="dark"] .inline-btn,
html[data-theme="dark"] .admin-form-section,
html[data-theme="dark"] .service-flow-step,
html[data-theme="dark"] .service-flow-field,
html[data-theme="dark"] .feedback-filter-btn,
html[data-theme="dark"] .order-tabs,
html[data-theme="dark"] .order-tab,
html[data-theme="dark"] .pager-btn,
html[data-theme="dark"] .admin-feedback-content,
html[data-theme="dark"] .admin-dialog,
html[data-theme="dark"] .date-picker-popover,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .admin-dialog-input,
html[data-theme="dark"] .balance-current-value {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

html[data-theme="dark"] .admin-feedback-item {
  border-bottom-color: var(--line);
  background: var(--panel);
}

html[data-theme="dark"] .admin-feedback-item:hover,
html[data-theme="dark"] .admin-feedback-item.open {
  background: var(--panel-soft);
}

html[data-theme="dark"] .admin-feedback-label.category-process {
  border-color: #2d72ad;
  background: #10283b;
  color: #9ed1ff;
}

html[data-theme="dark"] .admin-feedback-label.category-system {
  border-color: #6f5da5;
  background: #211b39;
  color: #c8beff;
}

html[data-theme="dark"] .admin-feedback-label.category-collaboration {
  border-color: #20795e;
  background: #102d27;
  color: #91e2c7;
}

html[data-theme="dark"] .admin-feedback-label.priority-important {
  border-color: #945c17;
  background: #33230d;
  color: #ffd18a;
}

html[data-theme="dark"] .admin-feedback-label.priority-urgent,
html[data-theme="dark"] .admin-feedback-form-error,
html[data-theme="dark"] .feedback-process-error {
  border-color: #873f48;
  background: #35171d;
  color: #ffb8c0;
}

html[data-theme="dark"] .event-item {
  border-bottom-color: var(--line);
}

html[data-theme="dark"] .task-log-head {
  border-bottom-color: var(--line);
  background: var(--panel-soft);
}

html[data-theme="dark"] .date-field input {
  background: var(--panel);
  box-shadow: none;
}

html[data-theme="dark"] .date-picker-day.muted,
html[data-theme="dark"] .date-picker-nav:disabled,
html[data-theme="dark"] .date-picker-day:disabled {
  color: #657386;
}

html[data-theme="dark"] .date-picker-foot {
  border-top-color: var(--line);
}

html[data-theme="dark"] .login-record-item {
  border-bottom-color: var(--line);
  background: var(--panel);
}

html[data-theme="dark"] .login-record-item.unusual {
  background: rgba(248, 113, 113, 0.12);
}

html[data-theme="dark"] .nav-item {
  color: var(--muted);
}

html[data-theme="dark"] .brand .brand-subtitle,
html[data-theme="dark"] .card-desc,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .workbench-label,
html[data-theme="dark"] .workbench-note,
html[data-theme="dark"] .admin-dialog-desc,
html[data-theme="dark"] .user-detail-sub,
html[data-theme="dark"] .user-wallet-card span,
html[data-theme="dark"] .user-wallet-card small,
html[data-theme="dark"] .user-detail-field span,
html[data-theme="dark"] .user-address-current span,
html[data-theme="dark"] .user-address-current small,
html[data-theme="dark"] .user-detail-mini-item small,
html[data-theme="dark"] .user-record-item small,
html[data-theme="dark"] .admin-feedback-meta,
html[data-theme="dark"] .admin-feedback-time,
html[data-theme="dark"] .event-time,
html[data-theme="dark"] .event-type {
  color: var(--muted);
}

html[data-theme="dark"] .user-detail-mini-item span,
html[data-theme="dark"] .user-record-item span {
  color: #b6c4d5;
}

html[data-theme="dark"] .admin-permission-scope {
  border-color: var(--line);
  border-left-color: var(--blue);
}

html[data-theme="dark"] .admin-permission-scope-pages span {
  border-color: var(--line-strong);
  background: var(--panel);
  color: #b9d8ff;
}

html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .secondary-btn:hover,
html[data-theme="dark"] .inline-btn:hover,
html[data-theme="dark"] .feedback-filter-btn.active,
html[data-theme="dark"] .feedback-filter-btn:hover,
html[data-theme="dark"] .order-tab.active,
html[data-theme="dark"] .order-tab:hover,
html[data-theme="dark"] .pager-btn.active {
  border-color: var(--line-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

html[data-theme="dark"] .inline-btn:disabled,
html[data-theme="dark"] .inline-btn:disabled:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: #64748b;
}

html[data-theme="dark"] .danger-btn:disabled,
html[data-theme="dark"] .danger-btn:disabled:hover {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

html[data-theme="dark"] .workbench-value {
  color: #7db7ff;
}

html[data-theme="dark"] .order-metric-switch,
html[data-theme="dark"] .order-empty-circle,
html[data-theme="dark"] .user-list-avatar,
html[data-theme="dark"] .user-wallet-card,
html[data-theme="dark"] .user-detail-field,
html[data-theme="dark"] .user-address-current {
  border-color: var(--line);
  background: var(--panel-soft);
}

html[data-theme="dark"] .order-visual-panel {
  border-color: transparent;
  background: transparent;
}

html[data-theme="dark"] .order-visual-total {
  border-color: transparent;
  background: transparent;
}

html[data-theme="dark"] .user-wallet-card.negative,
html[data-theme="dark"] .realname-state-card.unverified {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.12);
}

html[data-theme="dark"] .dashboard-info-head,
html[data-theme="dark"] .dashboard-order-table th,
html[data-theme="dark"] .dashboard-order-table td {
  border-color: var(--line);
}

html[data-theme="dark"] .dashboard-info-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.36);
  background-clip: padding-box;
}

html[data-theme="dark"] .enhanced-table.has-sticky-action th:last-child {
  background: var(--panel-soft);
  box-shadow: -1px 0 0 var(--line), -12px 0 20px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .enhanced-table.has-sticky-action td:last-child,
html[data-theme="dark"] .table-wrap > .empty,
html[data-theme="dark"] .admin-feedback-list > .empty,
html[data-theme="dark"] .events-list > .empty {
  border-color: var(--line);
  background: var(--panel);
}

html[data-theme="dark"] .enhanced-table.has-sticky-action tbody tr:hover td:last-child {
  background: var(--panel-soft);
}

html[data-theme="dark"] .dashboard-notice-item:hover,
html[data-theme="dark"] .dashboard-notice-item:focus-visible,
html[data-theme="dark"] .dashboard-order-table tbody tr:hover,
html[data-theme="dark"] .dashboard-order-table tbody tr:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

html[data-theme="dark"] .order-metric-btn {
  color: var(--muted);
}

html[data-theme="dark"] .order-metric-btn.active,
html[data-theme="dark"] .order-metric-btn:hover,
html[data-theme="dark"] .order-legend-item:hover {
  background: rgba(96, 165, 250, 0.12);
  color: var(--blue);
  box-shadow: none;
}

html[data-theme="dark"] .order-donut-bg {
  stroke: #233247;
}

html[data-theme="dark"] .order-donut-center {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

html[data-theme="dark"] .order-visual-panel .order-legend {
  background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .order-visual-panel .order-legend-item {
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .order-visual-panel .order-legend-item:hover {
  background: rgba(96, 165, 250, 0.12);
}

html[data-theme="dark"] .order-slice:hover {
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.32));
}

html[data-theme="dark"] th {
  background: var(--panel-soft);
  color: #b6c4d5;
}

html[data-theme="dark"] td,
html[data-theme="dark"] .test-order-table td {
  color: #d1dceb;
}

html[data-theme="dark"] .test-order-notice-message {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: #dbe7f5;
}

html[data-theme="dark"] .test-order-table th {
  background: var(--panel-soft);
  color: #c9d6e5;
}

html[data-theme="dark"] .test-order-table tbody tr:hover {
  background: rgba(96, 165, 250, 0.09);
}

html[data-theme="dark"] .requirement-sheet {
  border-color: #8d9bac;
  background: #fff;
}

html[data-theme="dark"] .requirement-sheet-body {
  background: #101a27;
}

html[data-theme="dark"] .return-order-badge {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

html[data-theme="dark"] .activity-lottery-preview {
  border-color: var(--line);
  background: var(--panel);
}

html[data-theme="dark"] .activity-lottery-preview-disk {
  border-color: #1b2a3d;
  box-shadow: 0 0 0 2px #28445f, 0 8px 18px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] .activity-lottery-preview-core {
  background: var(--panel);
}

html[data-theme="dark"] .admin-form input:disabled,
html[data-theme="dark"] .admin-form select:disabled {
  background: #101824;
  color: #8493a8;
}

@media (min-width: 1101px) {
  .service-editor-side {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 8px;
    overflow: hidden;
  }

  .service-editor-side > .service-basic-section {
    flex: 0 0 auto;
    min-height: 0;
    align-content: start;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .service-editor-side > .service-media-section {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-height: auto;
    margin-top: 0;
  }

  .service-editor-side .service-basic-grid {
    min-height: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "name name name"
      "processing price quote"
      "note note note";
  }

  .service-editor-side .service-name-field {
    grid-area: name;
  }

  .service-editor-side .service-processing-field {
    grid-area: processing;
  }

  .service-editor-side .service-price-field {
    grid-area: price;
  }

  .service-editor-side .service-quote-field {
    grid-area: quote;
  }

  .service-editor-side .service-note-field {
    grid-area: note;
    grid-column: 1 / -1;
    grid-template-rows: auto auto;
    min-height: 0;
    margin-top: -4px;
    width: 100%;
  }

  .service-editor-side .service-basic-field {
    gap: 4px;
    padding: 6px 7px;
  }

  .service-editor-side .service-basic-field > input,
  .service-editor-side .service-basic-field > select {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .service-editor-side .service-basic-field > textarea {
    min-height: 74px;
    max-height: 120px;
    resize: vertical;
  }

  .service-editor-side .service-media-panel {
    display: block;
    flex: 0 0 auto;
    min-height: auto;
  }

  .service-editor-side .service-media-image-row {
    flex: 0 0 auto;
    min-height: 128px;
  }

  .service-editor-side .service-media-setting-row {
    flex: initial;
  }
}

@media (max-width: 1300px) and (min-width: 1101px) {
  .service-editor-layout {
    grid-template-columns: minmax(210px, 0.76fr) minmax(360px, 1.34fr) minmax(330px, 1.2fr);
    gap: 10px;
  }

  .service-editor-layout.service-flow-collapsed {
    grid-template-columns: minmax(210px, 0.76fr) minmax(360px, 1.34fr) 40px;
  }

  .service-editor-layout > .service-flow-section {
    grid-column: auto;
  }

  .service-editor-dialog .service-flow-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-editor-dialog .service-flow-step:last-child {
    grid-column: 1 / -1;
  }

  .order-visual-panel:not(.is-empty) .order-visual-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 360px;
    justify-items: center;
    gap: 16px;
  }

  .order-visual-panel .order-visual-side {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .service-editor-dialog {
    width: calc(100vw - 32px);
  }

  .service-editor-form-body {
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .service-editor-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    height: auto;
  }

  .service-editor-layout.service-flow-collapsed {
    grid-template-columns: 1fr;
  }

  .service-editor-side {
    align-self: start;
    height: auto;
    min-height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .service-editor-layout > .service-flow-section {
    grid-column: auto;
    max-height: none;
    min-height: auto;
    overflow: visible;
  }

  .service-editor-dialog .service-flow-section.is-collapsed {
    padding: 0;
    min-height: 42px;
  }

  .service-editor-dialog .service-flow-section.is-collapsed .service-flow-section-title {
    flex-direction: row;
    justify-content: space-between;
    min-height: 42px;
  }

  .service-editor-dialog .service-flow-section.is-collapsed .service-flow-title-text {
    max-height: none;
    writing-mode: horizontal-tb;
  }

  .service-editor-dialog .service-flow-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  .service-editor-dialog .service-flow-step:last-child {
    grid-column: 1 / -1;
  }

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

  .finance-kpi-grid {
    grid-template-columns: repeat(5, minmax(132px, 1fr));
  }

  .dashboard-main {
    grid-template-columns: 1fr;
  }

  .dashboard-left,
  .order-visual-card,
  .dashboard-notice-card {
    grid-column: 1;
    height: auto;
  }

  .dashboard-info-card,
  .order-visual-card,
  .dashboard-notice-card {
    min-height: 360px;
  }

  .dashboard-info-head {
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 0;
    padding: 12px 16px;
  }

  .dashboard-info-filter {
    flex: 1 1 100%;
    grid-template-columns: minmax(0, 1fr) 80px 80px;
  }

  .order-visual-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .order-filter-bar {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .task-log-filter-bar {
    width: 100%;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .tab-panel.active:not([data-panel="dashboard"]) {
    height: auto;
    max-height: none;
  }

  .tab-panel.active:not([data-panel="dashboard"]) > .table-card,
  .tab-panel.active:not([data-panel="dashboard"]) > .test-order-page {
    height: auto;
  }

  .service-editor-dialog {
    width: calc(100vw - 24px);
  }

  .service-editor-form-body {
    padding: 10px 12px;
  }

  .service-editor-layout,
  .service-editor-layout > .service-flow-section {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .service-editor-dialog .service-flow-editor {
    grid-template-columns: 1fr;
  }

  .service-editor-dialog .service-flow-step:last-child {
    grid-column: auto;
  }

  .service-editor-dialog .service-flow-step-head {
    grid-template-columns: 1fr;
  }

  .service-editor-dialog .service-flow-step-head .mini-btn {
    grid-column: auto;
  }

  .service-basic-grid {
    grid-template-columns: 1fr;
  }

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

  .finance-reconcile-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .server-box {
    position: static;
    margin-top: 18px;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .top-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .admin-menu {
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

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

  .task-log-toolbar {
    align-items: stretch;
  }

  .task-log-filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .task-log-filter-bar .date-range-filter {
    grid-column: 1 / -1;
  }

  .dashboard-main {
    grid-template-columns: 1fr;
  }

  .dashboard-info-card,
  .order-visual-card,
  .dashboard-notice-card {
    min-height: 0;
  }

  .dashboard-info-filter {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .order-visual-head {
    align-items: stretch;
    flex-direction: column;
  }

  .order-metric-switch {
    width: max-content;
    max-width: 100%;
  }

  .order-visual-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .order-visual-panel:not(.is-empty) .order-visual-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
    justify-items: center;
    gap: 18px;
  }

  .order-visual-panel .order-visual-side {
    width: 100%;
  }

  .order-visual-side {
    width: 100%;
  }

  .card-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

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

  .order-filter-bar {
    grid-template-columns: 1fr;
  }

  .test-order-notice-bar {
    grid-template-columns: 1fr;
  }

  .test-order-notice-label,
  .test-order-notice-message {
    min-width: 0;
  }

  .test-order-notice-message {
    white-space: normal;
  }

  .requirement-sheet-body {
    padding: 12px;
  }

  .requirement-sheet-document-head,
  .requirement-sheet-foot {
    padding-right: 14px;
    padding-left: 14px;
  }

  .requirement-sheet-section {
    padding: 0;
  }

  .requirement-sheet-section h3 {
    padding-right: 10px;
    padding-left: 10px;
  }

  .requirement-sheet-document-head {
    grid-template-columns: 90px minmax(0, 1fr) 84px;
    gap: 6px;
    min-height: 92px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .requirement-sheet-brand img {
    width: 84px;
    height: 30px;
  }

  .requirement-sheet h2 {
    font-size: 18px;
  }

  .requirement-sheet-date {
    font-size: 11px;
  }

  .requirement-sheet-overview th,
  .requirement-sheet-table th {
    width: 118px;
    padding: 9px 10px;
  }

  .requirement-sheet-overview td,
  .requirement-sheet-table td {
    padding: 9px 10px;
  }

  .requirement-overview-col-order-label {
    width: 90px;
  }

  .requirement-overview-col-order-value {
    width: 120px;
  }

  .requirement-overview-col-service-label {
    width: 80px;
  }

  .requirement-overview-col-quantity-label {
    width: 54px;
  }

  .requirement-overview-col-quantity-value {
    width: 46px;
  }

  .requirement-sheet-sample-table th {
    width: 20%;
  }

  .requirement-sheet-sample-table td {
    width: 30%;
  }

  .requirement-sheet-sample-table th:nth-child(3) {
    width: 18%;
  }

  .requirement-sheet-sample-table td:nth-child(4) {
    width: 32%;
  }

  .requirement-sheet-remark {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .requirement-attachments-grid {
    grid-template-columns: 1fr;
    padding: 12px 14px 14px;
  }

  .activity-lottery-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-pager {
    flex-wrap: wrap;
  }

  .admin-feedback-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .task-log-grid {
    grid-template-columns: 1fr;
  }

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

  .user-record-item {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 560px) {
  .nav-list,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .top-actions,
  .toolbar-actions,
  .admin-form,
  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .admin-form-section-body,
  .media-section-body,
  .admin-permission-grid,
  .admin-service-scope-children,
  .service-flow-step-head,
  .service-flow-grid,
  .service-flow-checks {
    grid-template-columns: 1fr;
  }

  .admin-permission-mode-row {
    grid-template-columns: 1fr;
  }

  .admin-permission-scope-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-dialog-head {
    gap: 12px;
  }

  .order-detail-dialog-head {
    padding: 16px 18px;
  }

  .service-editor-dialog > .admin-dialog-head {
    padding: 16px 18px;
  }

  .activity-editor-dialog > .admin-dialog-head {
    padding: 16px 18px;
  }

  .activity-editor-form-body {
    padding: 14px 18px 6px;
  }

  .activity-editor-dialog > .admin-form > .admin-dialog-actions {
    padding: 12px 18px 16px;
  }

  .activity-target-user {
    width: 100%;
  }

  .service-editor-form-body {
    padding: 14px 18px 6px;
  }

  .service-editor-dialog > .admin-form > .admin-dialog-actions {
    padding: 12px 18px 16px;
  }

  .order-detail-body {
    padding: 16px 18px 6px;
  }

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

  .order-detail-row,
  .order-detail-row:nth-child(odd),
  .order-detail-row:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .order-detail-footer {
    padding: 12px 18px 16px;
  }

  .user-detail-head {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 18px;
  }

  .user-detail-avatar {
    width: 56px;
    height: 56px;
  }

  .user-wallet-grid,
  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .user-wallet-grid {
    padding: 16px 18px 0;
  }

  .user-detail-section {
    margin-right: 18px;
    margin-left: 18px;
  }

  .user-record-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workbench-value,
  .stat-value {
    font-size: 24px;
  }

  .order-visual-body {
    padding: 16px;
  }

  .order-visual-panels {
    grid-template-columns: 1fr;
  }

  .order-metric-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .order-metric-btn {
    min-width: 0;
  }

  .dashboard-info-head {
    padding: 12px;
  }

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

  .dashboard-info-filter .dashboard-date-range {
    grid-column: 1 / -1;
  }

  .dashboard-info-filter .primary-btn,
  .dashboard-info-filter .secondary-btn {
    width: 100%;
    min-width: 0;
  }

  .order-donut-wrap,
  .order-donut {
    width: 180px;
    height: 180px;
  }

  .order-donut-center {
    inset: 45px;
  }

  .order-visual-panel .order-donut-wrap,
  .order-visual-panel .order-donut {
    width: 144px;
    height: 144px;
  }

  .order-visual-panel .order-donut-center {
    inset: 36px;
  }

  .order-donut-center strong {
    font-size: 18px;
  }

  .primary-btn,
  .secondary-btn,
  .inline-btn,
  .danger-btn {
    width: 100%;
  }

  .row-actions .inline-btn,
  .row-actions .danger-btn {
    width: 100%;
  }

  .admin-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .event-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Narrow-screen adaptations. Desktop dimensions remain defined by the base rules above. */
@media (max-width: 1180px) and (min-width: 901px) {
  .app-shell {
    grid-template-columns: 206px minmax(0, 1fr);
  }

  .sidebar {
    padding: 16px 10px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .brand-logo {
    width: 132px;
    height: 50px;
  }

  .nav-item {
    padding: 0 12px;
  }

  .content {
    padding: 20px 24px 34px;
  }

  .topbar {
    margin: -20px -24px 20px;
    padding: 17px 24px 15px;
  }
}

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

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    height: auto;
    max-height: none;
    padding: 8px 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(24, 42, 62, 0.05);
  }

  .brand {
    display: flex;
    grid-column: 1;
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    padding: 0;
    text-align: left;
  }

  .brand-logo {
    width: 112px;
    height: 38px;
  }

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

  .sidebar-clock {
    grid-column: 2;
    gap: 1px;
    padding: 0;
    justify-items: end;
    text-align: right;
  }

  .sidebar-clock-date {
    font-size: 11px;
  }

  .sidebar-clock-time {
    font-size: 15px;
  }

  .nav-list {
    display: flex;
    grid-column: 1 / -1;
    grid-template-columns: none;
    grid-auto-rows: auto;
    align-items: center;
    max-height: none;
    min-height: 0;
    padding: 2px 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .nav-item.active,
  .nav-item:hover {
    box-shadow: inset 0 -2px 0 var(--blue);
  }

  .content {
    width: 100%;
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .topbar {
    position: static;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 0;
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .topbar > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar > div:first-child {
    flex: 1 1 240px;
  }

  .top-actions {
    flex: 0 1 auto;
    min-width: 0;
    gap: 7px;
    justify-content: flex-end;
  }

  .top-actions .secondary-btn,
  .top-actions .theme-btn,
  .top-actions .admin-menu {
    width: auto;
  }

  body.login-mode .topbar {
    position: fixed;
    inset: 0 0 auto 0;
    flex-direction: row;
    justify-content: flex-end;
    margin: 0;
    padding: 14px;
  }

  body.login-mode .login-panel {
    padding: 76px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .login-card {
    width: min(420px, 100%);
    padding: 30px 24px 26px;
  }

  .login-logo {
    width: 246px;
  }

  .tab-panel.active,
  .tab-panel[data-panel="dashboard"].active,
  .tab-panel.active:not([data-panel="dashboard"]) {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .tab-panel.active:not([data-panel="dashboard"]) .table-wrap {
    max-height: min(58dvh, 560px);
  }

  .tab-panel[data-panel="testOrders"] .order-table-wrap {
    max-height: min(58dvh, 560px);
  }

  .order-workbench {
    min-height: 0;
  }

  .table-wrap,
  .admin-feedback-table-wrap,
  .order-detail-table-wrap,
  .invoice-mail-table-wrap {
    max-width: 100%;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .table-resize-handle {
    display: none;
  }

  .enhanced-table.has-sticky-action th:last-child,
  .enhanced-table.has-sticky-action td:last-child {
    min-width: 136px;
  }

  .table-wrap .row-actions {
    flex-direction: row;
    justify-content: center;
  }

  .table-wrap .row-actions .inline-btn,
  .table-wrap .row-actions .danger-btn,
  .table-wrap .row-actions .primary-btn,
  .table-wrap .row-actions .secondary-btn {
    width: auto;
    min-width: 64px;
  }

  .order-tabs {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .order-tab {
    min-width: 78px;
    padding: 0 10px;
    font-size: 12px;
  }

  .order-filter-bar,
  .finance-filter-bar {
    gap: 8px;
    padding: 12px 14px;
  }

  .dashboard-info-head,
  .card-toolbar {
    padding: 13px 14px;
  }

  .dashboard-main {
    gap: 12px;
  }

  .stats-grid,
  .workbench-grid {
    gap: 12px;
  }

  .order-visual-body {
    padding: 18px;
  }

  .admin-dialog-overlay {
    padding: 10px;
  }

  .admin-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
  }

  .admin-dialog > .admin-dialog-head {
    position: sticky;
    top: 0;
    z-index: 6;
    padding-top: 16px;
    padding-bottom: 14px;
    background: var(--panel);
  }

  .admin-dialog > .admin-dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    background: var(--panel);
  }
}

@media (max-width: 620px) {
  .sidebar {
    gap: 4px 8px;
    padding: 7px 12px 0;
  }

  .brand-logo {
    width: 100px;
    height: 34px;
  }

  .brand .brand-subtitle {
    font-size: 10px;
  }

  .sidebar-clock {
    display: none;
  }

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

  .nav-list {
    padding-bottom: 7px;
  }

  .nav-item {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .content {
    padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    margin: -12px -12px 12px;
    padding: 12px;
  }

  .topbar > div:first-child {
    flex-basis: auto;
  }

  h1 {
    font-size: 22px;
  }

  .topbar p {
    margin-top: 4px;
    font-size: 12px;
  }

  .top-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-actions .admin-menu {
    max-width: 150px;
  }

  .top-actions .admin-name {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions .secondary-btn,
  .top-actions .theme-btn,
  .top-actions .admin-menu {
    width: auto;
  }

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

  .dashboard-main {
    gap: 10px;
  }

  .dashboard-info-card,
  .order-visual-card,
  .dashboard-notice-card {
    min-height: 0;
  }

  .dashboard-info-body,
  .order-visual-body {
    min-height: 96px;
  }

  .stat-card,
  .workbench-card {
    min-height: 92px;
    padding: 14px 10px;
  }

  .card-toolbar {
    gap: 10px;
  }

  .card-desc {
    line-height: 1.45;
  }

  .toolbar-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }

  .toolbar-actions .primary-btn,
  .toolbar-actions .secondary-btn,
  .card-toolbar > .primary-btn,
  .card-toolbar > .secondary-btn {
    width: auto;
    min-width: 96px;
  }

  .dashboard-info-filter,
  .task-log-filter-bar {
    gap: 8px;
  }

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

  .dashboard-info-filter .dashboard-date-range,
  .date-range-filter,
  .task-log-filter-bar .date-range-filter {
    grid-column: 1 / -1;
  }

  .date-range-filter {
    gap: 6px;
  }

  .table-wrap,
  .tab-panel.active:not([data-panel="dashboard"]) .table-wrap,
  .tab-panel[data-panel="testOrders"] .order-table-wrap {
    max-height: min(56dvh, 520px);
  }

  .enhanced-table.has-sticky-action th:last-child,
  .enhanced-table.has-sticky-action td:last-child {
    min-width: 124px;
  }

  .admin-dialog-overlay {
    padding: 8px;
  }

  .admin-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .theme-dialog {
    max-width: 360px;
  }

  .theme-dialog .admin-form {
    gap: 11px 12px;
  }

  .theme-dialog .theme-mode-grid {
    margin-top: 12px;
  }

  .admin-dialog > .admin-dialog-head {
    gap: 10px;
    padding: 14px 16px 12px;
  }

  .admin-dialog > .admin-dialog-actions {
    gap: 8px;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .admin-dialog > .admin-dialog-actions .primary-btn,
  .admin-dialog > .admin-dialog-actions .secondary-btn,
  .admin-dialog > .admin-dialog-actions .danger-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

/* The base dialog has a fixed light background for print-safe dialogs. Theme
   dialogs need an explicit dark override so the palette editor follows the
   selected theme while it is being previewed. */
html[data-theme="dark"] .theme-dialog,
html[data-theme="dark"] .theme-dialog .theme-mode-option,
html[data-theme="dark"] .theme-dialog .admin-dialog-actions {
  border-color: var(--line);
  background: var(--panel) !important;
  color: var(--text);
}

html[data-theme="dark"] .theme-dialog .theme-mode-option.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

html[data-theme="dark"] .theme-dialog input[type="color"] {
  border-color: var(--line);
  background: var(--panel-soft);
}

@media (max-width: 900px) {
  .primary-btn,
  .secondary-btn,
  .inline-btn,
  .danger-btn {
    height: 36px;
    min-width: 76px;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 12px;
  }

  .order-filter-bar,
  .finance-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-filter-bar > input,
  .order-filter-bar > select,
  .finance-filter-bar > select,
  .order-filter-bar .date-range-filter,
  .finance-filter-bar .date-range-filter {
    grid-column: 1 / -1;
  }

  .order-filter-bar > .primary-btn,
  .order-filter-bar > .secondary-btn,
  .finance-filter-bar > .primary-btn,
  .finance-filter-bar > .secondary-btn,
  .dashboard-info-filter .primary-btn,
  .dashboard-info-filter .secondary-btn,
  .task-log-filter-bar > .primary-btn,
  .task-log-filter-bar > .secondary-btn {
    width: auto;
    min-width: 0;
    height: 36px;
  }

  .row-actions {
    align-items: center;
    flex-direction: row;
    gap: 5px;
  }

  .row-actions .inline-btn,
  .row-actions .danger-btn,
  .row-actions .primary-btn,
  .row-actions .secondary-btn {
    width: auto;
    min-width: 64px;
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* Compact mobile controls: keep actions easy to scan without turning every
   command into a full-width block. */
@media (max-width: 620px) {
  .primary-btn,
  .secondary-btn,
  .inline-btn,
  .danger-btn {
    height: 34px;
    min-width: 72px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12px;
  }

  .theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
  }

  .top-actions {
    width: 100%;
    gap: 6px;
  }

  .top-actions .secondary-btn {
    min-width: 58px;
  }

  .top-actions .admin-menu {
    width: auto;
    min-width: 0;
    min-height: 34px;
    height: 34px;
    padding: 2px 8px 2px 4px;
  }

  .top-actions .admin-avatar,
  .top-actions .info-more-dots {
    width: 26px;
    height: 26px;
  }

  .top-actions .info-more-dots i {
    width: 3px;
    height: 3px;
  }

  .order-tab {
    height: 34px;
    min-width: 72px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12px;
  }

  .card-toolbar > .primary-btn,
  .card-toolbar > .secondary-btn,
  .toolbar-actions .primary-btn,
  .toolbar-actions .secondary-btn {
    min-width: 88px;
  }

  .order-filter-bar,
  .finance-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-filter-bar > input,
  .order-filter-bar > select,
  .finance-filter-bar > select {
    grid-column: 1 / -1;
  }

  .order-filter-bar .date-range-filter,
  .finance-filter-bar .date-range-filter {
    grid-column: 1 / -1;
  }

  .order-filter-bar > .primary-btn,
  .order-filter-bar > .secondary-btn,
  .finance-filter-bar > .primary-btn,
  .finance-filter-bar > .secondary-btn,
  .dashboard-info-filter .primary-btn,
  .dashboard-info-filter .secondary-btn,
  .task-log-filter-bar > .primary-btn,
  .task-log-filter-bar > .secondary-btn {
    width: auto;
    min-width: 0;
    height: 34px;
  }

  .row-actions {
    align-items: center;
    flex-direction: row;
    gap: 5px;
  }

  .row-actions .inline-btn,
  .row-actions .danger-btn,
  .row-actions .primary-btn,
  .row-actions .secondary-btn {
    width: auto;
    min-width: 62px;
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }

  .table-wrap .row-actions {
    flex-wrap: wrap;
  }

  .admin-dialog-actions .primary-btn,
  .admin-dialog-actions .secondary-btn,
  .admin-dialog-actions .danger-btn {
    height: 34px;
  }
}

/* 服务项目编辑页：三段始终纵向展示，内容紧凑且保持可滚动。 */
.service-editor-dialog .service-editor-form-body {
  padding: 12px 18px 8px;
}

.service-editor-dialog .service-editor-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.service-editor-dialog .service-identity-section,
.service-editor-dialog .service-editor-side,
.service-editor-dialog .service-flow-section {
  grid-row: auto;
  flex: 0 0 auto;
  min-width: 0;
}

.service-editor-dialog .service-editor-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.service-editor-dialog .admin-form-section {
  gap: 8px;
  padding: 12px;
}

.service-editor-dialog .service-flow-section {
  display: flex;
  flex-direction: column;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.service-editor-dialog .service-flow-section .service-flow-editor {
  flex: 0 0 auto;
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.service-editor-dialog .service-flow-step {
  gap: 8px;
  padding: 10px;
}

@media (max-width: 1100px) {
  .service-editor-dialog .service-editor-form-body {
    padding: 10px 12px 6px;
  }

  .service-editor-dialog .service-editor-layout {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* 基础信息采用两行四列布局，减少整行字段带来的留白。 */
.service-editor-dialog .service-editor-side .service-basic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "name name processing price"
    "note note quote quote";
  gap: 8px;
}

.service-editor-dialog .service-editor-side .service-basic-field {
  margin-top: 0;
}

.service-editor-dialog .service-editor-side .service-note-field {
  grid-area: note;
  align-self: start;
}

@media (max-width: 700px) {
  .service-editor-dialog .service-editor-side .service-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "name name"
      "processing price"
      "note note"
      "quote quote";
  }
}

@media (max-width: 440px) {
  .service-editor-dialog .service-editor-side .service-basic-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "processing"
      "price"
      "quote"
      "note";
  }
}

/* 项目介绍区按内容分列，避免多个整行文本框造成过多纵向留白。 */
.service-editor-dialog .service-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.service-editor-dialog .service-profile-grid > .service-basic-field.full-span {
  grid-column: auto;
}

.service-editor-dialog .service-profile-grid textarea {
  min-height: 66px;
  max-height: 112px;
}

.service-editor-dialog .service-profile-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 8px;
  align-items: stretch;
}

.service-editor-dialog .service-profile-precautions-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  min-width: 0;
  min-height: 100%;
  margin-top: 0;
}

.service-editor-dialog .service-editor-side .service-profile-precautions-field > textarea {
  height: 100%;
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
}

.service-editor-dialog .service-profile-bottom-row .service-media-section {
  min-width: 0;
  margin-top: 0;
}

@media (max-width: 440px) {
  .service-editor-dialog .service-profile-grid {
    grid-template-columns: 1fr;
  }

  .service-editor-dialog .service-profile-bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .service-editor-dialog .service-profile-bottom-row {
    grid-template-columns: 1fr;
  }
}
