:root {
  --ink: #162044;
  --muted: #68708a;
  --brand: #2026c8;
  --brand-2: #6c63d9;
  --line: #e5e8f4;
  --surface: #ffffff;
  --soft: #f6f7fc;
  --accent: #0f9f8f;
  --warn: #b56b00;
  --shadow: 0 20px 60px rgba(32, 38, 200, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI",
    sans-serif;
  background: #f8f9ff;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 249, 255, 0.96)),
    url("/assets/brand-bg.png") center top / cover no-repeat fixed;
}

.wrap {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 22px 16px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-lockup img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
}

.admin-link,
.ghost-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 232, 244, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.home-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: start;
}

.gate {
  padding: 22px;
}

.eyebrow {
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  margin: 0 0 8px;
}

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

h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 20px;
}

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

.field label {
  color: #323a5b;
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 13px 13px;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(32, 38, 200, 0.08);
}

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

.assessment-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  display: grid;
  gap: 10px;
}

.assessment-card.active {
  border-color: var(--brand);
  box-shadow: 0 14px 36px rgba(32, 38, 200, 0.12);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f2ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.tag.green {
  background: #eaf8f5;
  color: #087b70;
}

.tag.amber {
  background: #fff4df;
  color: var(--warn);
}

.btn {
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  padding: 12px 16px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.secondary {
  background: #edf0ff;
  color: var(--brand);
}

.btn.neutral {
  background: #eef2f6;
  color: #28324f;
}

.btn.danger {
  background: #fff0f0;
  color: #b42318;
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff8ea;
  color: #765110;
  line-height: 1.6;
  margin-top: 14px;
}

.error {
  color: #b42318;
  background: #fff0f0;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.5;
}

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

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

.survey-card,
.side-card,
.report-card,
.chat-card {
  padding: 20px;
}

.progress-bar {
  height: 9px;
  background: #edf0fb;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 18px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.question-title {
  font-size: 20px;
  line-height: 1.45;
  margin-bottom: 16px;
}

.options {
  display: grid;
  gap: 10px;
}

.option-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  line-height: 1.55;
}

.option-btn.selected {
  border-color: var(--brand);
  background: #f2f4ff;
  box-shadow: inset 4px 0 0 var(--brand);
}

.survey-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 18px;
}

.mini-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mini-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: #333c5f;
  line-height: 1.5;
}

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

.report-hero {
  padding: 24px;
  background: linear-gradient(135deg, rgba(32, 38, 200, 0.96), rgba(108, 99, 217, 0.9));
  color: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.report-hero .muted {
  color: rgba(255, 255, 255, 0.78);
}

.report-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 10px;
}

.section-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.report-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-card p {
  line-height: 1.75;
  white-space: pre-line;
  margin-bottom: 0;
}

.score-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.score-track {
  height: 9px;
  background: #edf0fb;
  border-radius: 999px;
  overflow: hidden;
}

.score-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.chat-card {
  display: grid;
  gap: 12px;
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
  padding-right: 3px;
}

.bubble {
  padding: 12px;
  border-radius: 8px;
  line-height: 1.65;
  white-space: pre-line;
}

.bubble.user {
  background: #eef2ff;
}

.bubble.assistant {
  background: #f4fbf9;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.poster-preview {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 40, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}

.modal-body {
  width: min(100%, 420px);
  max-height: 92vh;
  overflow: auto;
  background: white;
  border-radius: 8px;
  padding: 18px;
}

.hidden {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
  background: #f7f8fe;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

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

th {
  background: #f0f2ff;
  color: #273066;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .home-grid,
  .survey-layout,
  .report-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    padding: 18px 12px 34px;
  }
}

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

  .brand-name {
    font-size: 18px;
  }

  .gate,
  .survey-card,
  .side-card,
  .report-card,
  .chat-card {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .survey-actions {
    position: sticky;
    bottom: 0;
    padding: 10px 0 0;
    background: linear-gradient(180deg, rgba(248, 249, 255, 0), rgba(248, 249, 255, 1) 35%);
  }

  .survey-actions .btn {
    flex: 1;
  }
}

/* 学习力管家放大 */
.report-layout {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  gap: 18px;
}

.chat-card {
  padding: 28px;
  gap: 16px;
}

.chat-card h2 {
  font-size: 28px;
}

.chat-card textarea {
  min-height: 150px;
  font-size: 18px;
  line-height: 1.7;
}

@media (max-width: 560px) {
  .chat-card {
    padding: 22px 20px;
    gap: 18px;
  }

  .chat-card h2 {
    font-size: 30px;
  }

  .chat-card textarea {
    min-height: 180px;
    font-size: 18px;
  }
}
/* 学习力管家放大结束 */

/* 移动端修复 */
@media (max-width: 768px) {
  .result-container, .results-container, .report-container,
  [class*="result"], [class*="report"], [class*="layout"] {
    flex-direction: column !important;
    display: block !important;
    width: 100% !important;
  }
  .left-panel, .right-panel, .left-col, .right-col,
  [class*="left"], [class*="right"], [class*="sidebar"] {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    float: none !important;
  }
}

/* CUSTOMER_SEARCH_DELETE_PATCH_START */
.admin-search {
  width: 100%;
  box-sizing: border-box;
  margin: 14px 0 16px;
  padding: 12px 14px;
  border: 1px solid #dfe3f3;
  border-radius: 14px;
  background: #fff;
  color: #111a3d;
  font-size: 15px;
}

.op-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.delete-btn {
  color: #b42318 !important;
  background: #fff1f0 !important;
}

.delete-btn:hover {
  background: #ffe4e0 !important;
}

@media (max-width: 768px) {
  .op-buttons {
    gap: 6px;
  }

  .admin-search {
    font-size: 14px;
    padding: 11px 12px;
  }
}
/* CUSTOMER_SEARCH_DELETE_PATCH_END */



/* CUSTOMER_EDIT_PATCH_START */
.customer-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 24, 57, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.customer-edit-card {
  width: min(760px, 96vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(17, 24, 57, 0.22);
  position: relative;
  color: #111a3d;
}

.customer-edit-card h2 {
  margin: 0 0 20px;
}

.customer-edit-close {
  position: absolute;
  right: 18px;
  top: 16px;
  border: 0;
  background: #f1f3ff;
  color: #1f2bd8;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
}

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

.edit-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: #f8f9ff;
  border-radius: 16px;
  padding: 14px;
}

.edit-check {
  font-weight: 600;
  color: #111a3d;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .customer-edit-modal {
    padding: 12px;
    align-items: flex-start;
  }

  .customer-edit-card {
    margin-top: 20px;
    padding: 22px;
    border-radius: 20px;
  }

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

  .edit-actions {
    flex-direction: column-reverse;
  }

  .edit-actions .btn {
    width: 100%;
  }
}
/* CUSTOMER_EDIT_PATCH_END */





/* CUSTOMER_PERMISSION_SMALL_UI_START */

/* 防止整个页面横向撑开 */
html,
body {
  overflow-x: hidden;
}

/* 客户权限表格：只在表格内部滚动，不撑开整页 */
.customer-table-wrap {
  max-height: 460px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  border-radius: 14px !important;
}

/* 表格缩小，不再强行撑到很宽 */
.customer-table-wrap table {
  min-width: 760px !important;
  width: 100% !important;
  table-layout: fixed !important;
}

/* 表头固定 */
.customer-table-wrap thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 4 !important;
  background: #eef0ff !important;
}

/* 缩小整体行高和字体 */
.customer-table-wrap th,
.customer-table-wrap td {
  padding: 10px 10px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  vertical-align: middle !important;
}

/* 控制列宽 */
.customer-table-wrap th:nth-child(1),
.customer-table-wrap td:nth-child(1) {
  width: 80px !important;
}

.customer-table-wrap th:nth-child(2),
.customer-table-wrap td:nth-child(2) {
  width: 110px !important;
}

.customer-table-wrap th:nth-child(3),
.customer-table-wrap td:nth-child(3) {
  width: 300px !important;
  word-break: break-word !important;
}

.customer-table-wrap th:nth-child(4),
.customer-table-wrap td:nth-child(4) {
  width: 60px !important;
  white-space: nowrap !important;
}

.customer-table-wrap th:nth-child(5),
.customer-table-wrap td:nth-child(5) {
  width: 185px !important;
}

/* 操作按钮一行排列，变小 */
.customer-table-wrap .op-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.customer-table-wrap .op-buttons .small-btn {
  min-width: 48px !important;
  width: auto !important;
  height: 32px !important;
  padding: 0 9px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  line-height: 32px !important;
  white-space: nowrap !important;
}

/* 搜索框缩小 */
.admin-search {
  height: 44px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  border-radius: 14px !important;
  margin: 12px 0 14px !important;
}

/* 右侧客户权限卡片整体更紧凑 */
.admin-shell .panel.gate h2 {
  font-size: 24px !important;
}

/* 手机端：保持内部横向滚动 */
@media (max-width: 768px) {
  .customer-table-wrap {
    max-height: 380px !important;
  }

  .customer-table-wrap table {
    min-width: 720px !important;
  }

  .customer-table-wrap th,
  .customer-table-wrap td {
    padding: 9px 8px !important;
    font-size: 13px !important;
  }

  .customer-table-wrap .op-buttons .small-btn {
    min-width: 44px !important;
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    line-height: 30px !important;
  }
}

/* CUSTOMER_PERMISSION_SMALL_UI_END */

/* ADMIN_CENTER_LAYOUT_FIX_START */

/* 页面整体不要横向乱飘 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

/* 后台整体居中 */
.admin-shell .wrap,
.wrap {
  width: min(1280px, calc(100vw - 48px)) !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 顶部不要被挤出屏幕 */
.topbar {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 后台主体两栏布局：左侧固定，右侧自适应 */
.admin-grid {
  display: grid !important;
  grid-template-columns: 360px minmax(0, 1fr) !important;
  gap: 28px !important;
  align-items: start !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 右侧区域允许收缩，不再把页面撑宽 */
.section-stack {
  min-width: 0 !important;
  width: 100% !important;
}

/* 所有卡片不要超出容器 */
.panel,
.gate {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* 客户权限表格只在自己内部横向滚动 */
.customer-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: 460px !important;
}

/* 表格宽度控制，不再撑爆整个页面 */
.customer-table-wrap table {
  width: 100% !important;
  min-width: 720px !important;
  table-layout: fixed !important;
}

/* 列宽重新压紧 */
.customer-table-wrap th:nth-child(1),
.customer-table-wrap td:nth-child(1) {
  width: 70px !important;
}

.customer-table-wrap th:nth-child(2),
.customer-table-wrap td:nth-child(2) {
  width: 95px !important;
}

.customer-table-wrap th:nth-child(3),
.customer-table-wrap td:nth-child(3) {
  width: 280px !important;
}

.customer-table-wrap th:nth-child(4),
.customer-table-wrap td:nth-child(4) {
  width: 55px !important;
}

.customer-table-wrap th:nth-child(5),
.customer-table-wrap td:nth-child(5) {
  width: 170px !important;
}

/* 操作按钮保持紧凑 */
.customer-table-wrap .op-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
}

.customer-table-wrap .op-buttons .small-btn {
  min-width: 44px !important;
  height: 30px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  line-height: 30px !important;
  border-radius: 10px !important;
}

/* 平板和小屏：改成单栏，避免挤压 */
@media (max-width: 980px) {
  .admin-shell .wrap,
  .wrap {
    width: min(100% - 28px, 760px) !important;
  }

  .admin-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .customer-table-wrap {
    max-height: 420px !important;
  }
}

/* 手机端更紧凑 */
@media (max-width: 600px) {
  .admin-shell .wrap,
  .wrap {
    width: calc(100vw - 20px) !important;
  }

  .customer-table-wrap table {
    min-width: 680px !important;
  }
}

/* ADMIN_CENTER_LAYOUT_FIX_END */

/* ADMIN_TABLE_HEIGHT_FORCE_FIX_START */

/* 右侧所有表格区域：客户权限 + 测评报告 */
.admin-shell .section-stack > section.panel.gate .table-wrap,
.section-stack > section.panel.gate .table-wrap {
  max-height: 430px !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 16px !important;
}

/* 表格本身不要把页面撑长 */
.admin-shell .section-stack > section.panel.gate .table-wrap table,
.section-stack > section.panel.gate .table-wrap table {
  margin-bottom: 0 !important;
}

/* 表头固定 */
.admin-shell .section-stack > section.panel.gate .table-wrap thead th,
.section-stack > section.panel.gate .table-wrap thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: #eef0ff !important;
}

/* 行高收紧 */
.admin-shell .section-stack > section.panel.gate .table-wrap th,
.admin-shell .section-stack > section.panel.gate .table-wrap td,
.section-stack > section.panel.gate .table-wrap th,
.section-stack > section.panel.gate .table-wrap td {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* 手机端限高更小 */
@media (max-width: 768px) {
  .admin-shell .section-stack > section.panel.gate .table-wrap,
  .section-stack > section.panel.gate .table-wrap {
    max-height: 360px !important;
  }
}

/* ADMIN_TABLE_HEIGHT_FORCE_FIX_END */

/* REPORT_DETAIL_PATCH_START */
.report-detail-btn {
  min-width: 52px !important;
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  line-height: 32px !important;
  border-radius: 10px !important;
}

.report-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 24, 57, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.report-detail-card {
  width: min(960px, 96vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(17, 24, 57, 0.22);
  color: #111a3d;
  position: relative;
}

.report-detail-card h2 {
  margin: 0 0 20px;
}

.report-detail-close {
  position: absolute;
  right: 18px;
  top: 16px;
  border: 0;
  background: #f1f3ff;
  color: #1f2bd8;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
}

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

.report-detail-grid div {
  background: #f7f8ff;
  border-radius: 14px;
  padding: 12px 14px;
}

.report-detail-grid span {
  display: block;
  color: #68708f;
  font-size: 13px;
  margin-bottom: 5px;
}

.report-detail-grid strong {
  font-size: 15px;
}

.report-detail-section {
  margin-top: 22px;
}

.report-detail-section h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.report-detail-table th,
.report-detail-table td {
  border-bottom: 1px solid #e6e8f4;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.report-detail-table th:nth-child(1),
.report-detail-table td:nth-child(1) {
  width: 90px;
}

.report-detail-table th:nth-child(3),
.report-detail-table td:nth-child(3) {
  width: 140px;
}

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

.score-list span {
  background: #f1f3ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.analysis-block {
  background: #f7f8ff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.analysis-block p {
  margin: 8px 0 0;
  line-height: 1.7;
  color: #4f5878;
}

@media (max-width: 768px) {
  .report-detail-modal {
    padding: 12px;
    align-items: flex-start;
  }

  .report-detail-card {
    margin-top: 20px;
    padding: 22px;
    border-radius: 20px;
  }

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

  .report-detail-table {
    min-width: 680px;
  }

  .report-detail-section {
    overflow-x: auto;
  }
}
/* REPORT_DETAIL_PATCH_END */

/* RESULTS_OVERVIEW_START */
.results-overview {
  display: grid;
  gap: 16px;
}

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

.overview-head h2 {
  margin-bottom: 6px;
}

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

.overview-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 78px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
}

.overview-stat span {
  color: #404966;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.overview-stat strong {
  color: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.overview-stat.active {
  border-color: var(--brand);
  background: #f2f4ff;
  box-shadow: inset 4px 0 0 var(--brand);
}

.overview-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(140px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
}

.overview-filters .admin-search {
  margin: 0 !important;
}

.overview-filters select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.overview-table-wrap {
  max-height: 520px !important;
}

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

.overview-table-wrap th,
.overview-table-wrap td {
  font-size: 13px !important;
}

.overview-summary {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.45;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f2ff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

  .overview-filters {
    grid-template-columns: 1fr;
  }
}
/* RESULTS_OVERVIEW_END */

/* ADMIN_WORKBENCH_REDESIGN_START */
.admin-shell .wrap {
  width: min(1400px, calc(100vw - 48px)) !important;
  max-width: 1400px !important;
}

.admin-grid {
  grid-template-columns: 340px minmax(0, 1fr) !important;
  gap: 22px !important;
}

.create-customer-panel {
  position: sticky;
  top: 18px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(circle at 88% 18%, rgba(108, 99, 217, 0.18), transparent 30%),
    linear-gradient(135deg, #ffffff, #f5f3ff);
}

.admin-hero h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

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

.metric-card {
  min-height: 112px;
  border: 1px solid #e6e4fb;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(74, 61, 150, 0.08);
}

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

.metric-card strong {
  display: block;
  margin: 8px 0 6px;
  color: #7654f7;
  font-size: 34px;
  line-height: 1;
}

.metric-card.urgent strong {
  color: #b56b00;
}

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

.head-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.appointment-panel {
  display: grid;
  gap: 16px;
}

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-filter {
  min-height: 40px;
  border: 1px solid #e5e8f4;
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: #323a5b;
  font-weight: 800;
}

.status-filter strong {
  color: #7654f7;
}

.status-filter.active {
  border-color: #7654f7;
  background: #f3efff;
  color: #7654f7;
}

.compact-search {
  margin: 0 !important;
}

.appointment-list {
  display: grid;
  gap: 12px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.appointment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border: 1px solid #e8e9f4;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.appointment-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.appointment-title-row strong {
  font-size: 17px;
}

.appointment-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.appointment-status.pending {
  background: #fff4df;
  color: #a35d00;
}

.appointment-status.contacted {
  background: #eef0ff;
  color: #2026c8;
}

.appointment-status.done {
  background: #eaf8f5;
  color: #087b70;
}

.appointment-status.cancelled {
  background: #f1f3f8;
  color: #68708a;
}

.appointment-time {
  color: #111a3d;
  font-weight: 800;
  margin-bottom: 8px;
}

.appointment-person,
.appointment-contact,
.appointment-note {
  color: #555d78;
  line-height: 1.55;
  margin-top: 4px;
}

.appointment-note {
  color: #202742;
}

.appointment-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 86px;
}

.appointment-actions .small-btn {
  width: 86px;
}

.empty-state {
  border: 1px dashed #dfe3f3;
  border-radius: 16px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: #fafbff;
}

.results-overview,
.appointment-panel,
.admin-hero,
.section-stack > .panel {
  border-radius: 18px;
}

.overview-head {
  align-items: flex-start;
}

.overview-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.overview-stat {
  border-radius: 16px;
}

.overview-table-wrap,
.customer-table-wrap {
  border: 1px solid #edf0fb;
  border-radius: 16px !important;
  background: #fff;
}

@media (max-width: 1100px) {
  .admin-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .create-customer-panel {
    position: static;
  }

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

  .appointment-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .admin-shell .wrap {
    width: calc(100vw - 20px) !important;
  }

  .metric-grid,
  .overview-stats {
    grid-template-columns: 1fr !important;
  }

  .panel-head,
  .overview-head {
    flex-direction: column;
  }
}
/* ADMIN_WORKBENCH_REDESIGN_END */
