:root {
  --bg: #f6f3ee;
  --paper: #fffaf3;
  --ink: #241f1a;
  --muted: #7b7167;
  --line: #e7dbcc;
  --gold: #b5833a;
  --gold-dark: #7a5524;
  --green: #2f6b52;
  --danger: #b04538;
  --shadow: 0 14px 34px rgba(68, 49, 24, 0.11);
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

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

[hidden] { display: none !important; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(32, 21, 13, 0.92), rgba(58, 39, 21, 0.84)),
    radial-gradient(circle at top left, rgba(181, 131, 58, 0.28), transparent 34%),
    var(--bg);
}

.auth-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 238, 203, 0.28);
  border-radius: 8px;
  color: #fff7ec;
  background: rgba(35, 24, 15, 0.96);
  box-shadow: 0 22px 60px rgba(22, 14, 8, 0.3);
}

.auth-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 235, 191, 0.5);
  border-radius: 8px;
  color: #ffe2a5;
  font-weight: 800;
  letter-spacing: 1px;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card h1 {
  font-size: 28px;
}

.auth-card > p {
  margin-top: 9px;
  color: #d5c3ad;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label,
.auth-remember,
.auth-hint {
  color: #d5c3ad;
  font-size: 13px;
}

.auth-field input {
  width: 100%;
  border-color: rgba(255, 238, 203, 0.3);
  color: #fff7ec;
  background: rgba(255, 250, 243, 0.08);
}

.auth-field input::placeholder {
  color: rgba(255, 247, 236, 0.55);
}

.auth-remember {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-error {
  min-height: 20px;
  color: #ffb4a8;
  font-size: 13px;
}

.auth-hint {
  line-height: 1.6;
}

.app {
  display: grid;
  grid-template-columns: 288px 1fr;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 22px;
  color: #fff7ec;
  background: linear-gradient(180deg, #20150d, #3a2715);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 235, 191, 0.5);
  border-radius: 8px;
  color: #ffe2a5;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 20px; }
.brand p { margin-top: 5px; color: #d5c3ad; font-size: 12px; }

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

.nav-group-title {
  margin: 14px 8px 2px;
  color: rgba(255, 226, 165, 0.82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-group-title:first-child {
  margin-top: 0;
}

.nav-btn {
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  text-align: left;
  color: #f8ead9;
  background: transparent;
}

.nav-btn:hover, .nav-btn.active {
  color: #23180f;
  background: #f3d292;
}

.side-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 238, 203, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.side-title { margin-bottom: 8px; color: #ffe2a5; font-weight: 700; }
.side-card p { margin: 0; color: #ddcfbd; line-height: 1.7; font-size: 13px; }

.main {
  min-width: 0;
  height: 100vh;
  padding: 28px;
  overflow-y: auto;
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: -4px -4px 24px;
  padding: 4px 4px 16px;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(246, 243, 238, 0.96) 78%, rgba(246, 243, 238, 0) 100%);
}

.topbar h2 { margin: 0; font-size: 28px; }
.topbar p { margin: 7px 0 0; color: var(--muted); }
.top-actions, .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.top-actions { justify-content: flex-end; }

.primary-btn, .ghost-btn, .small-btn, .icon-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
}

.primary-btn { color: #fff; background: var(--gold-dark); }
.primary-btn:hover { background: #63431c; }
.ghost-btn, .small-btn { color: var(--gold-dark); background: #fffaf3; border-color: var(--line); }
.small-btn { padding: 7px 10px; font-size: 13px; }
.small-btn.danger { color: var(--danger); }
.small-btn.primary-mini {
  color: #fff;
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}
.small-btn.primary-mini:hover { background: #63431c; }
.danger-text { color: var(--danger); }
.icon-btn { width: 36px; height: 36px; padding: 0; background: #fff7ef; border-color: var(--line); }
.import-label { display: inline-flex; align-items: center; }
.link-btn { display: inline-flex; align-items: center; text-decoration: none; }

.action-menu {
  position: relative;
}

.action-menu summary {
  display: inline-flex;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 8px;
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  box-shadow: var(--shadow);
}

.action-menu-panel .ghost-btn {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  background: #fffdf8;
}

.page { display: none; }
.page.active { display: block; }

.daily-workbench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  min-width: 0;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.panel { padding: 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 18px; }

.workbench-queue {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin: 0;
}

.queue-list {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.queue-row {
  display: grid;
  min-width: 0;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border: 1px solid #eadfcf;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fffdf8;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.queue-row:hover { border-color: #c9aa76; box-shadow: 0 8px 20px rgba(68, 49, 24, 0.12); transform: translateY(-1px); }
.queue-row:focus-visible { outline: 3px solid rgba(181, 131, 58, 0.28); outline-offset: 3px; border-color: var(--gold); }
.queue-row-title { display: flex; min-width: 0; gap: 8px; align-items: baseline; justify-content: space-between; }
.queue-row-title strong, .queue-row-title span, .queue-row-trigger, .queue-row-action, .queue-row-due { overflow-wrap: anywhere; }
.queue-row-title span, .queue-row-trigger, .queue-row-due { color: var(--muted); font-size: 12px; }
.queue-row-action { color: var(--gold-dark); font-size: 13px; line-height: 1.45; }
.queue-empty { padding: 18px 4px; color: var(--muted); }

.toolbar {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.78);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.segmented .small-btn {
  border-color: transparent;
  background: transparent;
}

.segmented .small-btn.active {
  color: #fff;
  background: var(--gold-dark);
}

.workflow-note {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf3;
}

.search-input { min-width: min(420px, 100%); flex: 1; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdfa;
}

textarea { min-height: 90px; resize: vertical; }

.cards-list { display: grid; gap: 12px; }
.record-card { padding: 16px; }

.wechat-reminder-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

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

.wechat-reminder-head h3,
.wechat-reminder-head p { margin: 0; }
.wechat-reminder-head p { margin-top: 5px; color: var(--muted); line-height: 1.5; }
.wechat-state-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wechat-state {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  color: #684816;
  background: #f5e2bd;
  font-size: 12px;
}
.wechat-state.normal { color: #fff; background: var(--green); }
.wechat-state.error { color: #fff; background: var(--danger); }

.wechat-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wechat-summary-grid > button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 18px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
}
.wechat-summary-grid > button:last-child { border-right: 0; }
.wechat-summary-grid > button:hover { background: #fffaf3; }
.wechat-summary-grid span,
.wechat-summary-grid small { color: var(--muted); }
.wechat-summary-grid strong { font-size: 24px; }

.wechat-drawer-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 4px;
}
.wechat-drawer-tabs .active { color: #fff; border-color: var(--gold-dark); background: var(--gold-dark); }
.wechat-detail-section { margin-bottom: 22px; }
.wechat-detail-section h4 { margin: 0 0 10px; }
.wechat-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wechat-section-head h4 { margin: 0; }
.wechat-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.wechat-detail-row > div { display: grid; min-width: 0; gap: 4px; }
.wechat-detail-row span,
.wechat-detail-row small { color: var(--muted); overflow-wrap: anywhere; }
.wechat-detail-row small.danger-text { color: var(--danger); }
.wechat-config-list { display: grid; border-top: 1px solid var(--line); }
.wechat-config-list span { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.wechat-config-list strong { color: var(--ink); }
.record-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.record-title { margin: 0; font-size: 18px; }
.record-sub { margin: 5px 0 0; color: var(--muted); }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--gold-dark);
  background: #f4e3c5;
  font-size: 12px;
}
.tag.green { color: #fff; background: var(--green); }
.tag.red { color: #fff; background: var(--danger); }
.card-actions { display: flex; gap: 8px; }

.card-more {
  position: relative;
}

.card-more summary {
  display: inline-flex;
  list-style: none;
}

.card-more summary::-webkit-details-marker {
  display: none;
}

.card-more-panel {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 132px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.card-more-panel .small-btn {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.booking-slot-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.slot-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.slot-title-block {
  min-width: 0;
}

.slot-kicker {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
}

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

.slot-quick-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.slot-quick-info div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #f0e4d5;
  border-radius: 8px;
  background: #fffdf8;
}

.slot-quick-info span {
  color: var(--muted);
  font-size: 12px;
}

.slot-quick-info strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.slot-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.slot-status-actions .small-btn.active {
  color: #fff;
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.slot-match-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.slot-match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.slot-match-head h4 {
  margin: 0;
  color: var(--ink);
}

.slot-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.slot-match span,
.slot-match p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.slot-match-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.list-empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.table-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fffaf3;
}

.table-summary span {
  font-weight: 700;
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #efe2d2;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--gold-dark);
  background: #f7ecd8;
  font-size: 13px;
}

.data-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

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

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

.metric-grid div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

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

.metric-grid strong {
  overflow-wrap: anywhere;
  color: var(--gold-dark);
  font-size: 22px;
}

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

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

.service-risk-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d99a8d;
  border-left: 5px solid var(--danger);
  border-radius: 8px;
  background: #fff5f1;
  box-shadow: var(--shadow);
}

.service-risk-banner[hidden] {
  display: none;
}

.risk-banner-head,
.risk-banner-head > div {
  display: flex;
  gap: 12px;
  align-items: center;
}

.risk-banner-head {
  justify-content: space-between;
}

.risk-banner-head strong,
.risk-banner-head p {
  margin: 0;
}

.risk-banner-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.risk-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  background: var(--danger);
}

.risk-banner-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.risk-banner-list button {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #e7c7bd;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fffdf9;
  cursor: pointer;
}

.risk-banner-list button:hover {
  border-color: var(--danger);
  background: #fff8f5;
}

.risk-banner-list span,
.risk-banner-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-banner-list strong {
  color: var(--danger);
}

.task-empty {
  padding: 22px 10px;
  color: var(--muted);
  text-align: center;
}

.service-order-card {
  display: grid;
  gap: 14px;
}

.service-order-card.has-critical-risk {
  border-left: 5px solid var(--danger);
}

.service-order-card .record-meta {
  margin-top: 0;
}

.service-order-card .card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-risk-list > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  color: #7b531d;
  font-size: 12px;
  background: #fff0d5;
}

.order-risk-list > span.critical {
  color: #8e2c20;
  background: #ffe3dd;
}

.service-stage-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(90px, 1fr));
  overflow-x: auto;
  padding: 12px 4px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-stage-strip button {
  position: relative;
  display: grid;
  gap: 6px;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.service-stage-strip button::before {
  position: absolute;
  z-index: 0;
  top: 13px;
  right: 50%;
  left: -50%;
  height: 2px;
  content: "";
  background: #e8dccb;
}

.service-stage-strip button:first-child::before {
  display: none;
}

.service-stage-strip i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #d9c8b3;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: #fffdf8;
}

.service-stage-strip button.done::before,
.service-stage-strip button.active::before {
  background: var(--gold-dark);
}

.service-stage-strip button.done i,
.service-stage-strip button.active i {
  border-color: var(--gold-dark);
  color: #fff;
  background: var(--gold-dark);
}

.service-stage-strip button.active span {
  color: var(--gold-dark);
  font-weight: 800;
}

.service-stage-cancelled {
  padding: 12px;
  border-radius: 8px;
  color: var(--danger);
  font-weight: 800;
  text-align: center;
  background: #fff0ec;
}

.service-checklist {
  display: grid;
  gap: 10px;
}

.service-checklist-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.service-checklist-head > div:first-child {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.service-checklist-head span {
  color: var(--muted);
  font-size: 12px;
}

.checklist-progress {
  width: min(220px, 40%);
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #eadfce;
}

.checklist-progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.service-checklist-items {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.service-checklist-items button {
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf3;
  cursor: pointer;
}

.service-checklist-items button i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #ccb897;
  border-radius: 4px;
  font-size: 12px;
  font-style: normal;
}

.service-checklist-items button.done {
  border-color: #9fc8af;
  color: #155c3d;
  background: #edf8f1;
}

.service-checklist-items button.done i {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.service-order-summary {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 0.8fr;
  gap: 10px;
}

.service-order-summary > div {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f8f1e6;
}

.service-order-summary span {
  color: var(--muted);
  font-size: 12px;
}

.service-order-summary strong {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.focus-pulse {
  animation: focusPulse 1.5s ease;
}

@keyframes focusPulse {
  0%, 100% { box-shadow: var(--shadow); }
  35% { box-shadow: 0 0 0 4px rgba(165, 109, 31, 0.28), var(--shadow); }
}

.opportunity-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffdf8;
}

.opportunity-body {
  display: grid;
  gap: 5px;
}

.opportunity-body strong {
  color: var(--gold-dark);
}

.opportunity-body span,
.opportunity-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.health-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe2d2;
}

.health-bar span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--gold);
}

.health-bar span.green { background: var(--green); }
.health-bar span.red { background: var(--danger); }

.health-grid {
  display: grid;
  gap: 14px;
}

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

.health-summary div,
.health-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.health-summary div {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.health-summary strong {
  color: var(--gold-dark);
  font-size: 28px;
}

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

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
}

.health-row span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.health-row-score {
  display: grid;
  gap: 6px;
}

.health-row-score b {
  color: var(--gold-dark);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.method-grid h4 { margin: 0 0 8px; }
.method-grid p { margin: 0; color: var(--muted); line-height: 1.7; }

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.maintenance-grid div {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

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

.maintenance-grid strong {
  overflow-wrap: anywhere;
  color: var(--gold-dark);
  font-size: 15px;
}

.maintenance-report {
  width: 100%;
  min-height: 360px;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.55;
  white-space: pre;
}

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

.backup-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.backup-row > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.backup-row b { color: var(--ink); }
.backup-row span, .backup-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
}
.backup-row small { font-size: 12px; }

.modal {
  width: min(1080px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}
.modal::backdrop { background: rgba(20, 14, 9, 0.45); }
.modal-card { padding: 0; background: var(--paper); border-radius: 8px; overflow: hidden; }
.modal-head, .modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3, .modal-head p { margin: 0; }
.modal-head p { margin-top: 5px; color: var(--muted); }
.modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 13px; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }

.drawer-dialog {
  width: min(920px, calc(100vw - 28px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
}

.drawer-dialog::backdrop {
  background: rgba(20, 14, 9, 0.32);
}

.drawer-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -18px 0 42px rgba(36, 25, 13, 0.18);
}

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

.drawer-head h3,
.drawer-head p {
  margin: 0;
}

.drawer-head p {
  margin-top: 5px;
  color: var(--muted);
}

.drawer-body {
  display: block;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.duplicate-warning {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid #e0b15f;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: #5b3c16;
  background: #fff3d8;
}

.duplicate-warning strong,
.duplicate-warning p {
  margin: 0;
}

.duplicate-warning p {
  color: #795b32;
}

.duplicate-list {
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.member-search-field {
  position: relative;
}

.member-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.member-suggestions.active {
  display: block;
}

.member-suggestion {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0e4d5;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.member-suggestion:hover {
  background: #f6ead6;
}

.member-suggestion span,
.member-suggestion-empty {
  color: var(--muted);
  font-size: 12px;
}

.member-suggestion-empty {
  padding: 12px;
}

.detail-body {
  display: block;
  max-height: min(70vh, 720px);
  overflow: auto;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 8px;
  color: #fff7ec;
  background: linear-gradient(135deg, #20150d, #6f4c20);
}

.detail-hero h4,
.detail-hero p {
  margin: 0;
}

.detail-hero h4 {
  font-size: 22px;
}

.detail-hero p {
  margin-top: 6px;
  color: #ead8be;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.detail-score {
  display: grid;
  min-width: 104px;
  place-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 238, 203, 0.28);
  border-radius: 8px;
}

.detail-score strong {
  font-size: 26px;
}

.detail-score span {
  color: #ead8be;
  font-size: 12px;
}

.detail-stats,
.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
}

.detail-stats div,
.detail-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.detail-stats div {
  display: grid;
  gap: 4px;
  padding: 13px;
}

.detail-stats b {
  font-size: 20px;
  color: var(--gold-dark);
}

.detail-stats span,
.mini-row span,
.mini-empty {
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.detail-next-step {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffdf8;
}

.detail-next-step strong {
  color: var(--gold-dark);
}

.detail-next-step p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.detail-grid section {
  padding: 14px;
}

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

.detail-grid h4 {
  margin: 0 0 10px;
  color: var(--gold-dark);
}

.detail-grid p {
  margin: 0 0 9px;
  line-height: 1.7;
}

.mini-row {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid #f0e4d5;
}

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

.mini-empty {
  padding: 10px 0;
}

.drawer-body {
  background: #f8f3eb;
}

.member-command {
  display: grid;
  gap: 14px;
}

.detail-identity {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 8px;
  color: #fff8ee;
  background: #2b1b10;
}

.detail-identity-main {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.detail-avatar {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(247, 211, 143, 0.5);
  border-radius: 8px;
  color: #f8d38f;
  font-size: 22px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
}

.detail-identity h4,
.detail-identity p {
  margin: 0;
}

.detail-identity h4 {
  font-size: 22px;
}

.detail-identity h4 span {
  color: #d9c8b2;
  font-size: 15px;
  font-weight: 500;
}

.detail-identity p {
  margin-top: 5px;
  color: #d9c8b2;
}

.detail-identity .tag {
  color: #f2ddbd;
  border-color: rgba(242, 221, 189, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.detail-health {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.detail-health div {
  display: grid;
  min-width: 92px;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(247, 211, 143, 0.25);
  border-radius: 8px;
  text-align: center;
}

.detail-health strong {
  color: #f8d38f;
  font-size: 24px;
}

.detail-health span {
  color: #d9c8b2;
  font-size: 12px;
}

.detail-pipeline-card,
.detail-brief,
.detail-tab-panel,
.detail-profile-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.detail-pipeline-card {
  padding: 15px 16px;
}

.detail-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

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

.detail-section-head h4,
.detail-section-head strong {
  margin: 0;
}

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

.detail-section-head .eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.detail-pipeline button {
  position: relative;
  display: grid;
  gap: 6px;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.detail-pipeline button::before {
  position: absolute;
  z-index: 0;
  top: 13px;
  right: 50%;
  left: -50%;
  height: 2px;
  content: "";
  background: #eadfce;
}

.detail-pipeline button:first-child::before {
  display: none;
}

.detail-pipeline i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #dfd2c0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  background: #fffdf8;
}

.detail-pipeline button.done::before,
.detail-pipeline button.active::before {
  background: #a7732c;
}

.detail-pipeline button.done i,
.detail-pipeline button.active i {
  border-color: #a7732c;
  color: #fff;
  background: #a7732c;
}

.detail-pipeline button.active span {
  color: var(--gold-dark);
  font-weight: 800;
}

.detail-actions {
  position: relative;
  align-items: center;
  margin-bottom: 0;
}

.detail-more {
  position: relative;
}

.detail-more summary {
  list-style: none;
  cursor: pointer;
}

.detail-more summary::-webkit-details-marker {
  display: none;
}

.detail-more > div {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 138px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.detail-more > div .small-btn {
  width: 100%;
  text-align: left;
}

.detail-tabs {
  position: sticky;
  z-index: 10;
  top: -18px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 0 0;
  border-bottom: 1px solid var(--line);
  background: #f8f3eb;
}

.detail-tabs button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.detail-tabs button.active {
  border-bottom-color: var(--gold-dark);
  color: var(--gold-dark);
}

.detail-tabs button span {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  margin-left: 3px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  background: var(--gold-dark);
}

.detail-tab-panel {
  display: none;
  padding: 14px;
}

.detail-tab-panel.active {
  display: block;
}

.detail-tab-panel[hidden] {
  display: none !important;
}

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

.decision-card {
  display: flex;
  min-height: 166px;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.decision-card.primary {
  border-left: 4px solid var(--gold-dark);
}

.decision-card > span,
.decision-card small {
  color: var(--muted);
  font-size: 12px;
}

.decision-card strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 16px;
}

.decision-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.55;
}

.decision-card small {
  margin-top: auto;
}

.text-action {
  margin-top: auto;
  border: 0;
  padding: 0;
  color: var(--gold-dark);
  font-weight: 800;
  background: transparent;
  cursor: pointer;
}

.member-command .detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
}

.detail-brief {
  padding: 14px;
}

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

.detail-brief-grid > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: #f8f1e6;
}

.detail-brief-grid span {
  color: var(--muted);
  font-size: 12px;
}

.detail-brief-grid strong {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.profile-gap {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px dashed #c9a66d;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: #fff8e9;
  cursor: pointer;
}

.profile-gap span {
  display: grid;
  gap: 4px;
}

.profile-gap small {
  color: var(--muted);
}

.profile-gap b {
  flex: 0 0 auto;
  color: var(--gold-dark);
}

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

.detail-profile-grid section {
  padding: 14px;
}

.detail-profile-grid section.wide {
  grid-column: 1 / -1;
}

.detail-profile-grid h4 {
  margin: 0 0 8px;
  color: var(--gold-dark);
}

.detail-fact {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0e4d5;
}

.detail-fact:last-child {
  border-bottom: 0;
}

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

.detail-fact strong {
  overflow-wrap: anywhere;
  font-weight: 600;
  line-height: 1.55;
}

.detail-slot-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.detail-slot-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.detail-slot-card > div:first-child {
  display: grid;
  gap: 5px;
}

.detail-slot-card span,
.detail-slot-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.detail-slot-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.match-badge {
  display: inline-grid;
  min-width: 48px;
  height: 32px;
  place-items: center;
  border-radius: 16px;
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  background: var(--success);
}

.detail-timeline {
  display: grid;
  margin-top: 14px;
}

.detail-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  margin-left: 8px;
  padding: 0 0 18px 24px;
  border-left: 2px solid #e6d6c0;
}

.timeline-dot {
  position: absolute;
  top: 4px;
  left: -7px;
  width: 12px;
  height: 12px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: var(--gold-dark);
  box-shadow: 0 0 0 1px #cfa66b;
}

.detail-timeline time {
  color: var(--muted);
  font-size: 12px;
}

.detail-timeline b {
  display: block;
}

.detail-timeline p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-section {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--gold-dark);
  background: #f5ead8;
  font-weight: 800;
}

.profile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-grid div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffdf8;
}

.profile-grid b {
  color: var(--gold-dark);
  font-size: 13px;
}

.profile-grid span {
  color: var(--muted);
  line-height: 1.6;
}

.score {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: #1f1811;
  font-size: 12px;
  font-weight: 700;
}

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

.compact-business-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(118px, 0.9fr) minmax(105px, 0.72fr) minmax(148px, 1fr) auto minmax(185px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 13px 14px;
  cursor: default;
}

.compact-business-row:hover { border-color: #c9aa76; box-shadow: 0 8px 20px rgba(68, 49, 24, 0.1); }
.compact-business-main, .compact-business-money, .compact-business-next { display: grid; gap: 3px; min-width: 0; }
.compact-business-open {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}
.compact-business-open:hover strong { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.compact-business-open:focus-visible { border-radius: 4px; outline: 3px solid rgba(181, 131, 58, 0.28); outline-offset: 3px; }
.compact-business-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-business-main span, .compact-business-time, .compact-business-meta, .compact-business-money span, .compact-business-next { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.compact-booking-contact {
  overflow: hidden;
  color: #7b531d;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-business-money strong { color: var(--ink); font-size: 13px; }
.compact-business-next { color: #7b531d; }
.compact-business-actions { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; justify-content: flex-end; }
.compact-business-actions select { width: 70px; min-width: 70px; }
.compact-member-summaries { display: flex; min-width: 0; gap: 5px; overflow: hidden; }
.compact-member-summary { display: inline-flex; min-width: 0; gap: 5px; align-items: center; padding: 4px 7px; border-radius: 999px; color: #624113; background: #f7e5c2; font-size: 12px; white-space: nowrap; }
.compact-member-summary strong { overflow: hidden; max-width: 70px; text-overflow: ellipsis; }
.compact-member-summary b { color: #fff; font-size: 11px; }
.compact-member-summary b::before { content: ""; }
.compact-member-summary b { display: inline-grid; min-width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--green); }
.business-pagination { min-height: 20px; margin-top: 12px; }
.business-pagination-inner { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.business-pagination-inner > div { display: flex; gap: 8px; }
.business-drawer-content, .business-detail-section, .business-match-list { display: grid; gap: 14px; }
.business-detail-section { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.business-match-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0e4d5; }
.business-match-row:last-child { border-bottom: 0; }
.business-match-row span, .business-match-row p, .drawer-note { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }
.business-match-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.service-checklist-collapsed { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.service-checklist-collapsed summary { color: var(--ink); font-weight: 700; cursor: pointer; }
.record-card.compact { padding: 12px; box-shadow: none; }
.card-actions { flex-wrap: wrap; justify-content: flex-end; }

.toast-stack {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: #fffaf3;
  background: rgba(35, 24, 15, 0.95);
  box-shadow: 0 12px 26px rgba(30, 20, 12, 0.22);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.success { border-left-color: #7fb685; }
.toast.warn { border-left-color: #e0b15f; }
.toast.error { border-left-color: var(--danger); }

.toast.closing {
  opacity: 0;
  transform: translateY(8px);
}

@media (max-width: 920px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app { grid-template-columns: 1fr; }
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    gap: 10px;
    height: auto;
    overflow: hidden;
    padding: 12px 18px 10px;
    box-shadow: 0 8px 20px rgba(24, 15, 9, 0.2);
  }
  .brand {
    gap: 10px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }
  .brand h1 {
    font-size: 16px;
  }
  .brand p {
    display: none;
  }
  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .nav-group-title,
  .side-card {
    display: none;
  }
  .nav-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 9px 12px;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .main {
    height: auto;
    overflow: visible;
  }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .daily-workbench { grid-template-columns: 1fr; }
  .insight-layout, .method-grid, .profile-grid, .maintenance-grid, .detail-grid, .detail-stats, .metric-grid, .opportunity-grid, .health-summary, .health-row, .slot-match, .slot-quick-info { grid-template-columns: 1fr; }
  .panel.full { grid-column: auto; }
  .detail-grid .detail-wide { grid-column: auto; }
  .backup-row { align-items: flex-start; flex-direction: column; }
  .action-menu-panel { left: auto; right: 0; }
  .topbar { position: static; margin: 0 0 20px; padding: 0; background: transparent; }
  .slot-card-head { flex-direction: column; }
  .slot-head-actions,
  .slot-match-actions { justify-content: flex-start; }
  .detail-decision-grid,
  .detail-profile-grid,
  .detail-brief-grid { grid-template-columns: 1fr; }
  .detail-profile-grid section.wide { grid-column: auto; }
  .member-command .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-slot-card { grid-template-columns: 1fr; }
  .detail-slot-actions { justify-content: flex-start; flex-wrap: wrap; }
  .risk-banner-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-checklist-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-order-summary { grid-template-columns: 1fr; }
  .compact-business-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: start;
  }
  .compact-business-main { grid-column: 1; }
  .compact-business-time { grid-column: 2; text-align: right; }
  .compact-business-meta, .compact-business-money, .compact-member-summaries { grid-column: 1 / -1; }
  .compact-business-next { grid-column: 1 / -1; white-space: normal; }
  .compact-business-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .business-match-row { grid-template-columns: minmax(0, 1fr) auto; }
  .business-match-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .wechat-reminder-head { align-items: flex-start; flex-direction: column; }
  .wechat-reminder-head .ghost-btn { width: 100%; }
  .wechat-summary-grid { grid-template-columns: 1fr; }
  .wechat-summary-grid > button { border-right: 0; border-bottom: 1px solid var(--line); }
  .wechat-summary-grid > button:last-child { border-bottom: 0; }
  .wechat-detail-row { align-items: flex-start; flex-direction: column; }
  .compact-business-row { grid-template-columns: 1fr; }
  .compact-business-row > * { grid-column: 1; min-width: 0; }
  .compact-business-time { text-align: left; }
  .main { padding: 18px; }
  .sidebar { padding: 10px 12px 8px; }
  .modal-body { grid-template-columns: 1fr; }
  .drawer-dialog {
    width: 100%;
  }
  .record-top { flex-direction: column; }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 12px; }
  .detail-tabs { top: -12px; }
  .detail-identity { align-items: flex-start; flex-direction: column; }
  .detail-health { width: 100%; }
  .detail-health div { min-width: 0; flex: 1; }
  .detail-pipeline-card { overflow-x: auto; }
  .detail-pipeline { min-width: 520px; }
  .detail-section-head { align-items: flex-start; flex-direction: column; }
  .detail-timeline article { grid-template-columns: 1fr; gap: 5px; }
  .detail-fact { grid-template-columns: 82px minmax(0, 1fr); }
  .risk-banner-head { align-items: flex-start; flex-direction: column; }
  .risk-banner-list { grid-template-columns: 1fr; }
  .service-checklist-head { align-items: flex-start; flex-direction: column; }
  .checklist-progress { width: 100%; }
  .service-checklist-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-order-card .card-actions { justify-content: flex-start; }
  .compact-business-row { padding: 12px; }
  .compact-business-actions { flex-wrap: wrap; }
  .compact-member-summary strong { max-width: 96px; }
  .business-pagination-inner { align-items: flex-start; flex-direction: column; }
}
