:root {
  --primary: #BA945E;        /* 主色:金棕 */
  --primary-dark: #9C7A4A;
  --primary-light: #C9A878;
  --accent: #BA945E;
  --sidebar-bg: #2E2419;     /* 深棕侧边栏 */
  --sidebar-active: #BA945E;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  margin: 0;
}

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(46,36,25,.72) 0%, rgba(138,107,64,.65) 50%, rgba(186,148,94,.6) 100%),
              url('/images/back.jpg') center/cover no-repeat;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}
.login-logo i {
  font-size: 44px;
  color: var(--primary);
}
.login-logo h2 {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 600;
}
.login-logo p { margin: 0; font-size: 12px; }

/* 全局 Logo */
.app-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
}
.sidebar-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}
.login-tip {
  margin-top: 18px;
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* ============ 主框架 ============ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 22px; color: #fff; }
.sidebar-brand .sidebar-logo { margin-right: 8px; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav .menu-group-title {
  padding: 10px 20px 4px;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.sidebar-nav .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-nav .menu-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sidebar-nav .menu-item.active {
  background: rgba(186,148,94,.25);
  color: #fff;
  border-left-color: var(--sidebar-active);
}
.sidebar-nav .menu-item i { font-size: 16px; width: 18px; text-align: center; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.main {
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { margin: 0; flex: 1; font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

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

/* 侧边栏收起 */
body.sidebar-collapsed .sidebar { transform: translateX(-220px); }
body.sidebar-collapsed .main { margin-left: 0; }

/* ============ 通用组件 ============ */
.page-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 18px;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}
.stat-card .stat-label { font-size: 13px; color: #6b7280; }
.stat-card .stat-value { font-size: 22px; font-weight: 600; color: #111827; }

.bg-c1 { background: linear-gradient(135deg,#BA945E,#9C7A4A); }
.bg-c2 { background: linear-gradient(135deg,#C9A878,#BA945E); }
.bg-c3 { background: linear-gradient(135deg,#f59e0b,#d97706); }
.bg-c4 { background: linear-gradient(135deg,#ef4444,#dc2626); }
.bg-c5 { background: linear-gradient(135deg,#a855f7,#9333ea); }
.bg-c6 { background: linear-gradient(135deg,#14b8a6,#0d9488); }

.table th { background: #f9fafb; font-size: 13px; color: #6b7280; font-weight: 600; }
.table td { font-size: 13px; vertical-align: middle; }
.badge-soft-success { background: #d1fae5; color: #065f46; }
.badge-soft-danger  { background: #fee2e2; color: #991b1b; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-info    { background: #f5ead8; color: #8A6B40; }
.badge-soft-secondary { background: #e5e7eb; color: #374151; }
.badge-soft-primary { background: #dbeafe; color: #1e40af; }
.badge-soft-purple  { background: #ede9fe; color: #5b21b6; }
.badge-soft-pink    { background: #fce7f3; color: #9d174d; }
.badge-soft-teal    { background: #ccfbf1; color: #115e59; }
.badge-soft-orange  { background: #ffedd5; color: #9a3412; }

/* 跟进记录Tab按钮 */
.follow-tab-btn {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  transition: all .15s ease;
}
.follow-tab-btn:hover {
  background: #f3f4f6;
}
.follow-tab-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.follow-tab-btn.active .badge {
  background: rgba(255,255,255,.25) !important;
  color: #fff !important;
}

/* 预定相关样式 */
.btn-teal {
  background: #14b8a6;
  color: #fff;
  border: none;
}
.btn-teal:hover {
  background: #0d9488;
  color: #fff;
}
.btn-outline-teal {
  border: 1px solid #14b8a6;
  color: #14b8a6;
  background: transparent;
  border-radius: 6px;
  transition: all .15s ease;
}
.btn-outline-teal:hover {
  background: #14b8a6;
  color: #fff;
}
.btn-outline-teal.active {
  background: #14b8a6;
  color: #fff;
}
.text-teal { color: #14b8a6 !important; }
.reserve-chip {
  transition: all .15s ease;
  user-select: none;
}
.reserve-chip:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(20,184,166,.4);
}
.reserve-form-wrap .form-label {
  font-weight: 500;
}
.tag-chip {
  transition: all .15s ease;
  user-select: none;
}
.tag-chip.active {
  box-shadow: 0 0 0 2px rgba(59,130,246,.4);
  transform: scale(1.05);
}

/* 标签筛选栏 */
.tag-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 0;
}
.tag-filter-chip {
  transition: all .15s ease;
  user-select: none;
}
.tag-filter-chip:hover {
  transform: scale(1.05);
}
.tag-filter-chip.active {
  box-shadow: 0 0 0 2px rgba(59,130,246,.5);
  transform: scale(1.05);
}

.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.search-bar .form-control,
.search-bar .form-select {
  max-width: 200px;
}
.empty-tip {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}
.empty-tip i { font-size: 36px; margin-bottom: 8px; display: block; }

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
  color: #6b7280;
}

.form-label { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.required { color: #ef4444; }

/* ============ 覆盖 Bootstrap 主色为金棕 ============ */
.btn-primary { --bs-btn-bg: #BA945E; --bs-btn-border-color: #BA945E; --bs-btn-hover-bg: #9C7A4A; --bs-btn-hover-border-color: #9C7A4A; --bs-btn-active-bg: #8A6B40; --bs-btn-active-border-color: #8A6B40; --bs-btn-disabled-bg: #BA945E; --bs-btn-disabled-border-color: #BA945E; }
.btn-outline-primary { --bs-btn-color: #BA945E; --bs-btn-border-color: #BA945E; --bs-btn-hover-bg: #BA945E; --bs-btn-hover-border-color: #BA945E; --bs-btn-active-bg: #BA945E; --bs-btn-active-border-color: #BA945E; }
.text-primary { color: #BA945E !important; }
a { color: #BA945E; }
a:hover { color: #9C7A4A; }
.form-control:focus, .form-select:focus { border-color: #C9A878; box-shadow: 0 0 0 .2rem rgba(186,148,94,.18); }
.page-link { color: #BA945E; }
.page-link:hover { color: #9C7A4A; }
.page-item.active .page-link { background-color: #BA945E; border-color: #BA945E; }
.dropdown-item.active, .dropdown-item:active { background-color: #BA945E; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-220px); }
  .main { margin-left: 0; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .search-bar .form-control,
  .search-bar .form-select { max-width: 100%; flex: 1; }
}

/* ============ 来电弹窗 ============ */
.call-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: callFadeIn .2s ease;
}
@keyframes callFadeIn { from { opacity: 0; } to { opacity: 1; } }
.call-popup {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  animation: callSlideIn .25s ease;
}
@keyframes callSlideIn {
  from { transform: translateY(-30px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.call-popup-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.call-popup-header .call-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  animation: callPulse 1.2s ease-in-out infinite;
}
@keyframes callPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}
.call-popup-header .call-number {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
}
.call-popup-header .call-meta { margin-top: 4px; }
.call-popup-header .call-time { margin-top: 2px; opacity: .85; }
.call-popup-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.call-popup-footer {
  padding: 14px 22px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafafa;
}
.customer-card {
  background: #faf8f4;
  border: 1px solid #efe6d6;
  border-radius: 8px;
  padding: 14px;
}
.tag-picker .tag-chip.active { opacity: 1 !important; box-shadow: 0 0 0 2px var(--primary); }
