:root {
  --el-color-primary: #5BB89A;
  --el-color-primary-light-3: #7fc9b0;
  --el-color-primary-light-5: #9dd6c3;
  --el-color-primary-light-7: #bbe4d6;
  --el-color-primary-light-8: #caede2;
  --el-color-primary-light-9: #e8f6f1;
  --el-color-primary-dark-2: #499a7e;
  --bobo-bg: #f4f8f6;
  --bobo-sidebar: #ffffff;
  --bobo-text: #2c3e50;
  --bobo-muted: #7f8c8d;
}

* {
  box-sizing: border-box;
}

html, body, #app {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  color: var(--bobo-text);
  background: var(--bobo-bg);
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f6f1 0%, #d4ede4 50%, #c5e6da 100%);
  padding: 24px;
  position: relative;
}

.login-footer-slogan {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.28em;
  color: #5a7a6c;
  opacity: 0.88;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(91, 184, 154, 0.18);
  padding: 40px 36px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  color: var(--el-color-primary-dark-2);
  letter-spacing: 0.5px;
}

.login-brand p {
  margin: 0;
  color: var(--bobo-muted);
  font-size: 14px;
}

.login-form .el-input__wrapper {
  border-radius: 8px;
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  border-radius: 8px;
  height: 42px;
  font-size: 15px;
}

.login-captcha-row {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.login-captcha-row .el-input {
  flex: 1;
}

.login-captcha-img {
  flex: 0 0 128px;
  height: 40px;
  border: 1px solid #d4e8df;
  border-radius: 8px;
  background: #f3faf7;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a7a6c;
  font-size: 12px;
}

.login-captcha-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-captcha-img:hover {
  border-color: var(--el-color-primary);
}

/* Layout */
.layout-root {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.layout-sidebar {
  width: 232px;
  background: var(--bobo-sidebar);
  border-right: 1px solid #e8efeb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  position: relative;
}

.layout-root.sidebar-collapsed .layout-sidebar {
  width: 72px;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid #eef4f1;
  min-height: 72px;
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 20px;
  color: var(--el-color-primary-dark-2);
}

.sidebar-brand span {
  font-size: 13px;
  color: var(--bobo-muted);
}

.sidebar-brand-mini {
  display: block;
  text-align: center;
  font-size: 22px;
  color: var(--el-color-primary-dark-2);
}

.sidebar-menu {
  flex: 1;
  border-right: none !important;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-menu .el-menu-item,
.sidebar-menu .el-sub-menu__title {
  font-size: 15px !important;
  height: 48px !important;
  line-height: 48px !important;
}

.settings-submenu {
  border-top: 1px solid #eef4f1;
  margin-top: 4px;
  padding-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--bobo-muted);
  margin-top: 4px;
}

.follow-up-list {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding-right: 4px;
}

.follow-up-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f4faf7;
  border-radius: 8px;
  font-size: 13px;
}

.follow-up-extra {
  margin-top: 6px;
  font-size: 12px;
  color: var(--bobo-muted);
}

.follow-up-extra-row {
  display: flex;
  gap: 8px;
  line-height: 1.5;
}

.follow-up-extra-label {
  color: #5a6a72;
  min-width: 64px;
}

.follow-up-extra-label::after {
  content: "：";
}

.sidebar-menu .el-menu-item.is-active {
  background: var(--el-color-primary-light-9) !important;
  color: var(--el-color-primary-dark-2) !important;
  font-weight: 500;
}

.layout-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.layout-header {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8efeb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 16px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid #e8efeb;
  border-radius: 8px;
  background: #fff;
  color: var(--bobo-text);
  cursor: pointer;
  line-height: 1;
  font: inherit;
}

.sidebar-toggle-btn:hover {
  background: var(--el-color-primary-light-9);
  border-color: var(--el-color-primary-light-5);
  color: var(--el-color-primary-dark-2);
}

.sidebar-toggle-icon {
  display: block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.sidebar-toggle-label {
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.header-app-dl {
  color: #2F6F5E;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
}

.header-app-dl:hover {
  background: #e8f6f1;
  color: #1f4f42;
}

.impersonate-banner {
  background: #fff7e6;
  border-bottom: 1px solid #ffd591;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #ad6800;
  flex-shrink: 0;
}

.layout-content {
  flex: 1;
  overflow: auto;
  padding: 20px 24px;
}

.page-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 600;
}

.page-title-hint {
  margin-left: 12px;
  font-size: 13px;
  font-weight: 400;
  color: #e34d59;
  vertical-align: middle;
}

.audit-json {
  margin: 0;
  padding: 12px;
  background: #f7f8fa;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow: auto;
}

.page-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .el-input,
.toolbar .el-select,
.toolbar .el-button {
  font-size: 14px;
}

.toolbar .el-input__wrapper,
.toolbar .el-select .el-select__wrapper {
  min-height: 36px;
}

.phone-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  line-height: 1.2;
}

.phone-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--el-color-primary-dark-2);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 0;
}

.phone-call-btn:hover:not(:disabled) {
  background: var(--el-color-primary-light-9);
  color: var(--el-color-primary);
}

.phone-call-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.phone-call-icon {
  display: block;
  width: 14px;
  height: 14px;
}

.el-table {
  font-size: 14px !important;
}

.el-table th.el-table__cell {
  font-size: 14px !important;
  background: #f7fbf9 !important;
}

.el-form-item__label {
  font-size: 14px !important;
}

/* Dashboard KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border-left: 4px solid var(--el-color-primary);
}

.kpi-card .label {
  font-size: 13px;
  color: var(--bobo-muted);
  margin-bottom: 8px;
}

.kpi-card .value {
  font-size: 26px;
  font-weight: 600;
  color: var(--el-color-primary-dark-2);
}

.section-subtitle {
  margin: 4px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #2F6F5E;
}

.kpi-card.kpi-clickable {
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.kpi-card.kpi-clickable:hover {
  box-shadow: 0 4px 16px rgba(91, 184, 154, 0.22);
  transform: translateY(-1px);
}
.kpi-split {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.kpi-sep {
  color: var(--bobo-muted);
  font-weight: 400;
}
.kpi-link {
  cursor: pointer;
  color: var(--el-color-primary-dark-2);
  border-bottom: 2px solid transparent;
}
.kpi-link:hover {
  color: var(--el-color-primary);
  border-bottom-color: var(--el-color-primary);
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 960px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
  .layout-sidebar {
    width: 64px;
  }
  .sidebar-brand h2,
  .sidebar-brand span {
    display: none;
  }
}

.chart-box {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.chart-box h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
}

.chart-container {
  height: 280px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar-wrap {
  row-gap: 10px;
}

.selection-hint {
  margin: -4px 0 12px;
  font-size: 13px;
  color: var(--bobo-muted);
}

.toolbar .el-input,
.toolbar .el-select {
  width: auto;
}

.table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
}

.table-actions .el-button {
  margin: 0 !important;
  padding: 0 4px !important;
}

.empty-hint {
  text-align: center;
  padding: 48px 24px;
  color: var(--bobo-muted);
}

.empty-hint .el-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.docs-page h3 {
  margin: 28px 0 12px;
  font-size: 16px;
  color: var(--bobo-primary, #5BB89A);
}

.docs-page h3:first-child {
  margin-top: 0;
}

.docs-page p,
.docs-page li {
  line-height: 1.7;
  color: #445;
}

.docs-page ul,
.docs-page ol {
  padding-left: 1.4em;
}

.code-block {
  background: #f4faf7;
  border: 1px solid #d9eee4;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  color: #2c3e50;
  margin: 10px 0 16px;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 14px;
}

.docs-table th,
.docs-table td {
  border: 1px solid #d9eee4;
  padding: 8px 12px;
  text-align: left;
}

.docs-table th {
  background: #eef8f3;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cdr-player-meta {
  font-size: 13px;
  color: var(--bobo-muted, #888);
  word-break: break-all;
}
.cdr-player-seek {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  margin: 8px 0 4px;
  font-size: 12px;
  color: #666;
}
.cdr-player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
