/* ============================================
   付物密探 - 管理后台
   品牌色：#1e3a6e 深海军蓝
   设计：专业简洁后台风
   ============================================ */

:root {
  --brand: #1e3a6e;
  --brand-light: #2a5298;
  --brand-dark: #0d1f45;
  --brand-bg: rgba(30,58,110,0.04);
  --brand-border: rgba(30,58,110,0.15);
  --success: #16A34A;
  --success-bg: rgba(22,163,74,0.08);
  --warning: #CA8A04;
  --warning-bg: rgba(202,138,4,0.08);
  --danger: #DC2626;
  --danger-bg: rgba(220,38,38,0.08);
  --info: #2563EB;
  --info-bg: rgba(37,99,235,0.08);

  --bg: #f0f2f5;
  --bg-secondary: #f8fafc;
  --bg-muted: #f3f4f6;
  --bg-hover: rgba(30,58,110,0.06);
  --card: #ffffff;
  --border: #e5e7eb;
  --border-light: #f0f2f5;

  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text: var(--text-primary);
  --muted: var(--text-muted);

  --sidebar-w: 240px;
  --header-h: 60px;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 布局 ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── 侧边栏 ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brand);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar__brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sidebar__sub {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.sidebar__nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar__group {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar__group-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 12px 6px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar__item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}

.sidebar__item--active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
}

.sidebar__icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar__user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ── 主内容区 ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 移动端菜单按钮 — 桌面端隐藏 */
.mobile-menu-btn {
  display: none;
}

.header__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__notify {
  position: relative;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.header__notify-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card);
}

.content {
  flex: 1;
  padding: 24px;
}

/* ── 卡片 ── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card__body {
  padding: 20px;
}

.card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── 统计卡片 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card__icon--brand { background: var(--brand-bg); color: var(--brand); }
.stat-card__icon--success { background: var(--success-bg); color: var(--success); }
.stat-card__icon--warning { background: var(--warning-bg); color: var(--warning); }
.stat-card__icon--danger { background: var(--danger-bg); color: var(--danger); }
.stat-card__icon--info { background: var(--info-bg); color: var(--info); }

.stat-card__info {
  flex: 1;
  min-width: 0;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-card__trend {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-card__trend--up { color: var(--success); }
.stat-card__trend--down { color: var(--danger); }

/* ── 表格 ── */
.table-wrap {
  overflow-x: auto;
}

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

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}

tr:hover td {
  background: var(--brand-bg);
}

/* ── 状态标签 ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag--success { background: var(--success-bg); color: #166534; }
.tag--warning { background: var(--warning-bg); color: #92400e; }
.tag--danger { background: var(--danger-bg); color: #991b1b; }
.tag--info { background: var(--info-bg); color: #1e40af; }
.tag--brand { background: var(--brand-bg); color: var(--brand); }
.tag--muted { background: #f3f4f6; color: var(--text-secondary); }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-light);
}

.btn--success { background: var(--success); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--warning { background: var(--warning); color: #fff; }

.btn--outline {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn--outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-bg);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 6px 10px;
}
.btn--ghost:hover { color: var(--brand); }

.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--lg { padding: 12px 24px; font-size: 15px; }

/* ── 表单 ── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-required { color: var(--danger); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30,58,110,0.08);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── 搜索/筛选栏 ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar__search {
  position: relative;
}

.toolbar__search-input {
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  width: 260px;
  background: #fff;
}

.toolbar__search-input:focus {
  outline: none;
  border-color: var(--brand);
}

.toolbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── 空状态 ── */
.empty {
  text-align: center;
  padding: 60px 20px;
}

.empty__icon { font-size: 48px; margin-bottom: 12px; }
.empty__text { font-size: 14px; color: var(--text-muted); }

/* ── 分页 ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 0;
}

.pagination__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.15s;
}

.pagination__btn:hover {
  background: var(--brand-bg);
  color: var(--brand);
}

.pagination__btn--active {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

/* ── 模态框 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.2s;
  display: flex;
  flex-direction: column;
}

.modal--md {
  max-width: 960px;
  max-height: 90vh;
}

.modal--lg {
  max-width: 1280px;
  max-height: 92vh;
}

.modal--xl {
  width: 95vw;
  max-width: none;
  height: 95vh;
  max-height: 95vh;
}

/* 全屏弹窗：100vw × 100vh，无圆角，无外边距 */
.modal--full {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  margin: 0;
}

.modal--full .modal__body {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.modal--lg .modal__body,
.modal--xl .modal__body {
  max-height: calc(92vh - 120px);
  overflow-y: auto;
}

.modal--md .modal__body {
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal__title {
  font-size: 16px;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  background: transparent;
  border: none;
}
.modal__close:hover { background: #f3f4f6; }

.modal__body { padding: 24px; }

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── 聊天区 ── */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--header-h) - 48px);
  gap: 0;
}

.chat-list {
  width: 300px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--card);
}

.chat-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.chat-list__item:hover { background: var(--brand-bg); }
.chat-list__item--active { background: var(--brand-bg); border-left: 3px solid var(--brand); }

.chat-list__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-list__info { flex: 1; min-width: 0; }

.chat-list__name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list__preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list__meta {
  flex-shrink: 0;
  text-align: right;
}

.chat-list__time {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-list__unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}

.chat-main__header {
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-main__name {
  font-size: 14px;
  font-weight: 700;
}

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

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 70%;
  display: flex;
  gap: 8px;
}

.chat-msg--coach { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg--agent { align-self: flex-start; }

.chat-msg__bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg--coach .chat-msg__bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg--agent .chat-msg__bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  padding: 10px 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--brand);
}

/* ── 聊天扩展样式 ── */

/* 输入工具栏 */
.chat-input-tools {
  display: flex;
  gap: 4px;
}

.chat-tool-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.chat-tool-btn:hover {
  background: var(--brand-bg);
  border-color: var(--brand);
}

/* 图片消息 */
.chat-msg__image {
  max-width: 240px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.chat-msg__image img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.chat-msg__image-loading {
  width: 200px;
  height: 120px;
  background: var(--brand-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 14px;
}

/* 文件消息 */
.chat-msg__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px;
  transition: background 0.15s;
}

.chat-msg__file:hover {
  background: rgba(255,255,255,0.18);
}

.chat-msg--agent .chat-msg__file {
  background: var(--brand-bg);
}

.chat-msg--agent .chat-msg__file:hover {
  background: rgba(30,58,110,0.08);
}

.chat-msg__file-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.chat-msg__file-info {
  flex: 1;
  min-width: 0;
}

.chat-msg__file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg__file-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-msg__file-download {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 空状态 */
.chat-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.chat-active-state {
  display: none;
  flex-direction: column;
  height: 100%;
}

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 工具类 ── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.flow-step-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }

/* ── Tab切换（财务/认证/报表） ── */
.finance-tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  user-select: none;
}
.finance-tab:hover {
  color: var(--text-primary);
}
.finance-tab--active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}

/* ── 危险按钮 ── */
.btn--danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--danger:hover {
  background: #b91c1c;
}

/* ── 品牌管理专用样式 ── */
.brand-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

/* Region / Level mini stat cards */
.stat-mini-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-light, #e5e7eb);
}
.stat-mini-card__val {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand, #1e3a6e);
}
.stat-mini-card__lbl {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  margin-top: 4px;
}
.stat-mini-card__loading {
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
}

.brand-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.brand-card:hover {
  box-shadow: 0 4px 20px rgba(30,58,110,0.12);
  transform: translateY(-2px);
}

/* ── 品牌列表响应式网格 ── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
@media (min-width: 1400px) {
  .brands-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (min-width: 1800px) {
  .brands-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (min-width: 2200px) {
  .brands-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 768px) {
  .brands-grid { grid-template-columns: 1fr; }
}

.course-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.course-card:hover {
  box-shadow: 0 4px 20px rgba(30,58,110,0.12);
  transform: translateY(-2px);
}

.btn--xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}
.btn--xs:hover { opacity: 0.8; }

/* ── 报名管理 ── */
.app-group {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.app-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  background: #f8fafc;
  transition: background 0.15s;
  user-select: none;
}
.app-group__header:hover { background: #f0f4f8; }
.app-group__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.app-group__brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.app-group__title {
  color: var(--text-secondary);
  font-size: 13px;
}
.app-group__meta {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-bg);
  padding: 2px 10px;
  border-radius: 10px;
}
.app-group__arrow {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.app-group__body {
  border-top: 1px solid var(--border-light);
  overflow-x: auto;
}
.app-group__batch {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  text-align: right;
}

/* ── 报名列表内联用户信息标签 ── */
.app-phone  { font-family: "SF Mono","Fira Code",monospace; font-size: 12px; color: #374151; white-space: nowrap; }
.app-city   { font-size: 12px; color: #6b7280; white-space: nowrap; }

/* 经验摘要: Lv.3 | 12单 | 4.8分 */
.app-exp { font-size: 12px; color: #374151; white-space: nowrap; }
.app-exp b { color: #1e3a6e; font-weight: 700; }
.app-exp__sep { color: #d1d5db; margin: 0 2px; }
.app-exp--na { color: #9ca3af; }

/* 近30天活跃 */
.app-recent { display: inline-block; font-size: 12px; font-weight: 700; white-space: nowrap; padding: 1px 8px; border-radius: 8px; }
.app-recent--ok  { background: #d1fae5; color: #065f46; }
.app-recent--low { background: #f3f4f6; color: #9ca3af; }

.app-tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 8px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  vertical-align: middle;
}
.app-tag--ok     { background: #d1fae5; color: #065f46; }
.app-tag--warn   { background: #fef3c7; color: #92400e; }
.app-tag--no     { background: #f3f4f6; color: #9ca3af; }
.app-tag--danger { background: #fee2e2; color: #991b1b; }
.app-tag--muted  { background: #f3f4f6; color: #9ca3af; }

/* 冲突行高亮 */
.app-row--warn { background: #fffbeb; }
.app-row--warn:hover td { background: #fef3c7 !important; }

/* ── 报名详情面板 ── */
.d-detail { display: flex; flex-direction: column; gap: 20px; }
.d-section {
  background: #fff;
  border: 1px solid var(--border-light,#e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}
.d-section__title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  padding: 14px 20px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-light,#e5e7eb);
}

/* 信息网格 */
.d-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  padding: 0;
}
@media (max-width: 860px) { .d-info-grid { grid-template-columns: 1fr 1fr; } }
.d-info-card {
  padding: 16px 20px;
  border-right: 1px solid var(--border-light,#f3f4f6);
}
.d-info-card:last-child { border-right: none; }
.d-info-card__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a6e 0%, #3b82f6 100%);
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.d-info-card__name {
  text-align: center;
  font-size: 15px; font-weight: 700;
  color: #1f2937;
  margin-bottom: 2px;
}
.d-info-card__role {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted,#6b7280);
}

/* 信息行 */
.d-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: #374151;
}
.d-info-row + .d-info-row { border-top: 1px solid #f9fafb; }
.d-label {
  color: var(--text-muted,#9ca3af);
  font-size: 12px;
  flex-shrink: 0;
  margin-right: 12px;
}

/* 状态徽章 */
.d-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px; font-weight: 600;
  line-height: 1.6;
}
.d-badge--success { background: #d1fae5; color: #065f46; }
.d-badge--warning { background: #fef3c7; color: #92400e; }
.d-badge--info    { background: #dbeafe; color: #1e40af; }
.d-badge--danger  { background: #fee2e2; color: #991b1b; }
.d-badge--default { background: #f3f4f6; color: #6b7280; }

/* 详情表格 */
.d-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.d-table th {
  text-align: left;
  padding: 10px 16px;
  background: #f9fafb;
  color: var(--text-muted,#6b7280);
  font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border-light,#e5e7eb);
  white-space: nowrap;
}
.d-table td {
  padding: 9px 16px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.d-table tr:last-child td { border-bottom: none; }
.d-table tr:hover td { background: #f9fafb; }
.d-row--success td { background: #f0fdf4; }
.d-row--success:hover td { background: #dcfce7; }
.d-row--muted td { color: #9ca3af; }

/* 关联检查 */
.d-check-warn, .d-check-ok {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  border-radius: 8px;
  margin: 0 0;
}
.d-check-warn { background: #fef2f2; }
.d-check-warn__icon, .d-check-ok__icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.d-check-warn__text, .d-check-ok__text { font-size: 13px; color: #374151; line-height: 1.6; }
.d-check-ok { background: #f0fdf4; }

.page__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 12px;
}
.page__subtitle b {
  color: var(--brand);
  font-weight: 700;
}

.table-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.btn--success {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.btn--success:hover { background: #059669; }

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; transform: translateX(-100%); transition: transform 0.3s ease; }
  .sidebar--open { transform: translateX(0); }
  .mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 999; }
  .mobile-overlay--visible { display: block; }
  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; font-size: 18px; cursor: pointer; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
  .mobile-menu-btn:hover { background: var(--bg-muted); }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .chat-list { width: 100%; }
  .chat-main { display: none; }
}

/* ── 操作日志标签 ── */
.logs__action-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.logs__action-tag[data-action="login"],
.logs__action-tag[data-action="logout"] { background: #e0e7ff; color: #3730a3; }
.logs__action-tag[data-action="create"],
.logs__action-tag[data-action="upload"] { background: #d1fae5; color: #065f46; }
.logs__action-tag[data-action="update"],
.logs__action-tag[data-action="batch"] { background: #fef3c7; color: #92400e; }
.logs__action-tag[data-action="delete"] { background: #fee2e2; color: #991b1b; }
.logs__action-tag[data-action="query"],
.logs__action-tag[data-action="export"] { background: #e0f2fe; color: #075985; }
.logs__action-tag[data-action="review"] { background: #f3e8ff; color: #6b21a8; }
.logs__action-tag[data-action="account"] { background: #fce7f3; color: #9d174d; }

/* ── 城市多选标签 ── */
.city-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
}
.city-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.city-chip--active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.city-chip--active:hover {
  background: var(--brand-light);
  color: #fff;
}

/* ── 执行中任务管理 ── */

/* Badge system */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--active { background: var(--brand-bg); color: var(--brand); }
.badge--pending { background: rgba(139,92,246,0.08); color: #8b5cf6; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warn { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--muted { background: #f3f4f6; color: #9ca3af; }

/* Stats bar */
.inprogress-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.stat-chip__num {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}
.stat-chip__label {
  color: var(--text-secondary);
  font-size: 12px;
}
.stat--info .stat-chip__num { color: var(--info); }
.stat--active .stat-chip__num { color: var(--brand); }
.stat--pending .stat-chip__num { color: #8b5cf6; }
.stat--warn .stat-chip__num { color: var(--warning); }
.stat--danger .stat-chip__num { color: var(--danger); }

/* Task title in cell */
.inprogress-task-title {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inprogress-task-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Agent info in cell */
.inprogress-agent {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inprogress-agent__name {
  font-weight: 600;
  font-size: 13px;
}
.inprogress-agent__phone {
  font-size: 12px;
  color: var(--text-muted);
  font-family: "SF Mono","Fira Code",monospace;
  margin-top: 2px;
}
.inprogress-agent__city {
  font-size: 11px;
  color: var(--text-muted);
}
.badge--level {
  background: var(--brand-bg);
  color: var(--brand);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Progress display */
.inprogress-progress {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 180px;
}

/* Deadline display */
.inprogress-deadline--overdue { color: var(--danger); font-weight: 600; }
.inprogress-deadline--urgent { color: var(--danger); }
.inprogress-deadline--soon { color: var(--warning); }

/* Row warning states */
.inprogress-row--danger { background: var(--danger-bg) !important; }
.inprogress-row--warn { background: var(--warning-bg) !important; }

/* Action buttons group */
.inprogress-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.btn--danger-outline {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn--danger-outline:hover { background: var(--danger); color: #fff; }

/* Candidate list in reassign modal */
.inprogress-candidates {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.inprogress-candidate {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s;
}
.inprogress-candidate:last-child { border-bottom: none; }
.inprogress-candidate:hover { background: var(--brand-bg); }
.inprogress-candidate__name { font-weight: 600; font-size: 13px; }
.inprogress-candidate__info { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Detail modal grid */
.inprogress-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .inprogress-detail-grid { grid-template-columns: 1fr; }
}
.inprogress-detail-section h4 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

/* Detail rows (reusing d-detail pattern) */
.d-detail-row {
  display: flex;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.d-detail-row:last-child { border-bottom: none; }
.d-detail-label {
  width: 80px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* Timeline in detail */
.inprogress-timeline {
  padding-left: 8px;
}
.inprogress-timeline__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
}
.inprogress-timeline__item:not(:last-child) {
  border-left: 2px solid var(--border);
  margin-left: 5px;
  padding-left: 19px;
}
.inprogress-timeline__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  border: 2px solid var(--border);
  background: var(--bg);
}
.inprogress-timeline__dot--done { background: var(--brand); border-color: var(--brand); }
.inprogress-timeline__dot--active { background: var(--info); border-color: var(--info); animation: inprogress-pulse 1.5s infinite; }
.inprogress-timeline__dot--warn { background: var(--warning); border-color: var(--warning); }
@keyframes inprogress-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* ========== 日历视图 ========== */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.calendar-weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 0;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  background: var(--bg);
  border: 1px solid transparent;
  transition: all 0.15s;
  min-height: 58px;
}
.calendar-day:hover {
  background: var(--bg-hover);
  border-color: var(--brand);
}
.calendar-day--empty {
  cursor: default;
  background: transparent;
}
.calendar-day--empty:hover {
  background: transparent;
  border-color: transparent;
}
.calendar-day--today {
  border-color: var(--brand);
  background: var(--brand-light, rgba(30,58,110,0.06));
}
.calendar-day--selected {
  background: var(--brand);
  border-color: var(--brand);
}
.calendar-day--selected .calendar-day__num {
  color: #fff;
}
.calendar-day--selected .calendar-day__badge {
  background: rgba(255,255,255,0.3);
  color: #fff;
}
.calendar-day__num {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.calendar-day__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.calendar-day--has-tasks {
  background: var(--brand-light, rgba(30,58,110,0.04));
}

/* ═══════════════ 品牌详情面板 v2 — 专业仪表盘风格 ═══════════════ */

/* 面板根容器 */
.bd-panel { display: flex; flex-direction: column; gap: 0; min-height: 500px; }

/* ── 品牌头部：紧凑信息条 ── */
.bd-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: var(--brand);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.bd-hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.bd-hero::before {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.bd-hero__logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.2);
  position: relative;
  z-index: 1;
}
.bd-hero__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.bd-hero__body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.bd-hero__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.bd-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  opacity: 0.9;
  flex-wrap: wrap;
}
.bd-hero__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.25);
}
.bd-hero__tag--active { background: rgba(22,163,74,0.3); border-color: rgba(22,163,74,0.4); }
.bd-hero__tag--pause { background: rgba(202,138,4,0.3); border-color: rgba(202,138,4,0.4); }
.bd-hero__tag--stop { background: rgba(220,38,38,0.3); border-color: rgba(220,38,38,0.4); }
.bd-hero__divider { width: 1px; height: 16px; background: rgba(255,255,255,0.25); flex-shrink: 0; }

/* 头部右侧指标 */
.bd-hero__metrics {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.bd-metric {
  text-align: center;
  padding: 10px 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  backdrop-filter: blur(4px);
  min-width: 64px;
}
.bd-metric__num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.bd-metric__label { font-size: 11px; opacity: 0.8; margin-top: 2px; }

/* ── 标签导航 ── */
.bd-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}
.bd-nav__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text-secondary);
  border-radius: 8px;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
  position: relative;
}
.bd-nav__item:hover { background: var(--brand-bg); color: var(--brand); }
.bd-nav__item--active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,110,0.25);
  border-color: var(--brand);
}
.bd-nav__count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(0,0,0,0.08);
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.bd-nav__item--active .bd-nav__count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ── 概览页：KPI 卡片行 ── */
.bd-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.bd-kpi {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.bd-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.bd-kpi__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.bd-kpi__icon--tpl { background: #dbeafe; color: #2563EB; }
.bd-kpi__icon--store { background: #d1fae5; color: #059669; }
.bd-kpi__icon--task { background: #fef3c7; color: #d97706; }
.bd-kpi__icon--report { background: #ede9fe; color: #7c3aed; }
.bd-kpi__num { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.bd-kpi__label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.bd-kpi__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.bd-kpi__sub em { font-style: normal; color: var(--success); font-weight: 600; }
.bd-kpi__sub.warn em { color: var(--warning); }
.bd-kpi__sub.danger em { color: var(--danger); }

/* ── 概览页：双栏内容区 ── */
.bd-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 20px;
}

/* 品牌信息卡片 */
.bd-info-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bd-info-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}
.bd-info-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bd-info-card__body { padding: 16px 20px; }

/* 信息字段网格 */
.bd-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.bd-field {
  display: flex;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border-light);
}
.bd-field:last-child { border-bottom: none; }
.bd-field__label {
  width: 72px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.bd-field__value {
  color: var(--text-primary);
  font-weight: 500;
}
.bd-desc-block {
  grid-column: 1/-1;
  padding: 12px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--border-light);
}
.bd-desc-block .bd-field__label { align-self: flex-start; margin-top: 2px; }
.bd-desc-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 8px;
}

/* 城市标签 */
.bd-city-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.bd-city-tag {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--brand-bg);
  color: var(--brand);
  font-weight: 500;
}

/* 右侧面板 */
.bd-side-panel { display: flex; flex-direction: column; gap: 16px; }

/* 快捷操作卡片 */
.bd-actions-card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bd-actions-card__head {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 700;
}
.bd-actions-card__body { padding: 14px 18px; }
.bd-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bd-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.bd-action-btn:hover {
  border-color: var(--brand);
  background: var(--brand-bg);
  color: var(--brand);
  transform: translateY(-1px);
}
.bd-action-btn__icon { font-size: 22px; }
.bd-action-btn__text { font-size: 12px; }

/* 合同期卡片 */
.bd-contract-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.bd-contract-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bd-contract-dates {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #15803d;
}
.bd-contract-date {
  background: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid #bbf7d0;
}
.bd-contract-sep { color: #86efac; font-size: 12px; }
.bd-contract-status {
  margin-top: 10px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border: 1px solid #bbf7d0;
}
.bd-contract-status--ok { color: #166534; }
.bd-contract-status--warn { color: #d97706; background: #fef3c7; border-color: #fde68a; }
.bd-contract-status--exp { color: #dc2626; background: #fee2e2; border-color: #fecaca; }

/* ── 最近活动区 ── */
.bd-recent {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bd-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}
.bd-recent__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bd-recent__body { padding: 0; }

/* 紧凑任务列表 */
.bd-task-list { list-style: none; }
.bd-task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
  cursor: pointer;
}
.bd-task-item:last-child { border-bottom: none; }
.bd-task-item:hover { background: var(--brand-bg); }
.bd-task-item__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bd-task-item__status--avail { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.bd-task-item__status--hot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }
.bd-task-item__status--closed { background: #d1d5db; }
.bd-task-item__status--draft { background: #94a3b8; }
.bd-task-item__info { flex: 1; min-width: 0; }
.bd-task-item__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bd-task-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}
.bd-task-item__progress {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.bd-progress-bar {
  width: 48px;
  height: 5px;
  background: var(--bg-muted);
  border-radius: 3px;
  overflow: hidden;
}
.bd-progress-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width 0.3s;
}
.bd-task-item__reward {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
  min-width: 56px;
  text-align: right;
}

/* ── 模板列表（概览内） ── */
.bd-tpl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bd-tpl-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.15s;
  cursor: pointer;
  background: var(--card);
}
.bd-tpl-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bd-tpl-card--active { border-left: 3px solid #22c55e; }
.bd-tpl-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.bd-tpl-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.bd-tpl-card__ver {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.bd-tpl-card__stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.bd-tpl-card__stat { display: flex; align-items: center; gap: 4px; }

/* ── 门店表格（概览内） ── */
.bd-store-table-wrap { padding: 0 !important; }

/* ── Tab 内容区通用 ── */
.bd-section {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.bd-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}
.bd-section__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bd-section__count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}
.bd-section__body { padding: 0; }

/* 空状态 */
.bd-empty {
  text-align: center;
  padding: 56px 20px;
}
.bd-empty__icon { font-size: 52px; margin-bottom: 14px; opacity: 0.6; }
.bd-empty__title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.bd-empty__desc { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; max-width: 320px; margin-left: auto; margin-right: auto; line-height: 1.5; }

/* ── 模板/门店/任务 Tab 内列表 ── */

/* 模板卡片列表 */
.bd-tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.bd-tpl-full {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.15s;
  background: var(--card);
  position: relative;
}
.bd-tpl-full:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.bd-tpl-full--active { border-left: 4px solid #22c55e; }
.bd-tpl-full__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.bd-tpl-full__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.bd-tpl-full__badges { display: flex; gap: 6px; align-items: center; }
.bd-tpl-full__stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.bd-tpl-full__stat { display: flex; align-items: center; gap: 4px; }
.bd-tpl-full__actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

/* 门店/任务表格容器 */
.bd-table-wrap { padding: 0; }

/* ── 响应式 ── */
@media (max-width: 1200px) {
  .bd-kpi-row { grid-template-columns: 1fr 1fr; }
  .bd-main-grid { grid-template-columns: 1fr; }
  .bd-side-panel { flex-direction: row; }
  .bd-actions-card { flex: 1; }
  .bd-contract-card { width: 260px; flex-shrink: 0; }
  .bd-tpl-grid, .bd-tpl-list { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .bd-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .bd-hero__metrics { width: 100%; justify-content: space-between; }
  .bd-metric { flex: 1; }
  .bd-kpi-row { grid-template-columns: 1fr 1fr; }
  .bd-fields { grid-template-columns: 1fr; }
  .bd-action-grid { grid-template-columns: 1fr 1fr; }
  .bd-side-panel { flex-direction: column; }
  .bd-contract-card { width: auto; }
}