/* CustomerManager Demo Styles */
:root {
  --primary: #059669;
  --primary-light: #10B981;
  --primary-dark: #047857;
  --primary-bg: #ECFDF5;
  --secondary: #64748B;
  --accent: #0D9488;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #06B6D4;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--gray-800); }
a { text-decoration: none; color: inherit; }
input, button, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* Login — H3C ICT Theme */
.login-body {
  --h3c-red: #E60012;
  --h3c-red-dark: #C4000F;
  --h3c-blue: #0B1D3A;
  --h3c-blue-light: #132D54;
  --h3c-accent: #3B82F6;
  --h3c-cyan: #22D3EE;
  min-height: 100vh;
  min-height: 100dvh;
  background: #030810;
  overflow-x: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-h3c-logo {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 100;
  display: block;
  pointer-events: auto;
  text-decoration: none;
  user-select: none;
  line-height: 0;
}
.login-h3c-logo-img {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(200px, 42vw);
}
.login-h3c-mark {
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.06em;
  color: var(--h3c-red);
  line-height: 1;
  font-family: Arial, Helvetica, 'PingFang SC', sans-serif;
  text-shadow: 0 0 24px rgba(230, 0, 18, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.login-h3c-tagline {
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  line-height: 1;
}
.login-h3c-tagline::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--h3c-red), #3B82F6);
  border-radius: 1px;
  opacity: 0.85;
}

.login-ict-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ict-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.ict-bg-mesh {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 15% 25%, rgba(230, 0, 18, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 35% at 60% 20%, rgba(59, 130, 246, 0.12), transparent 50%),
    radial-gradient(ellipse 45% 40% at 30% 80%, rgba(230, 0, 18, 0.08), transparent 55%);
  animation: ictMeshDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

.ict-grid-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.5) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 15%, transparent 80%);
  animation: ictGridScroll 20s linear infinite;
}

.ict-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(108deg,
      rgba(3, 8, 16, 0.72) 0%,
      rgba(3, 8, 16, 0.35) 42%,
      rgba(3, 8, 16, 0.5) 68%,
      rgba(3, 8, 16, 0.78) 100%),
    radial-gradient(ellipse 90% 60% at 20% 40%, rgba(230, 0, 18, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(34, 211, 238, 0.1), transparent 50%),
    linear-gradient(to top, rgba(3, 8, 16, 0.85) 0%, transparent 35%);
}

.ict-hex-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z' fill='none' stroke='%2322D3EE' stroke-width='0.6'/%3E%3Cpath d='M28 36 L56 52 L56 84 L28 100 L0 84 L0 52 Z' fill='none' stroke='%23E60012' stroke-width='0.4'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  animation: ictHexDrift 30s linear infinite;
}

.ict-data-streams span {
  position: absolute;
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(34, 211, 238, 0.8), transparent);
  z-index: 5;
  opacity: 0;
  animation: ictDataFall 4s linear infinite;
}
.ict-data-streams span:nth-child(1)  { left: 8%;  animation-delay: 0s;    animation-duration: 3.5s; }
.ict-data-streams span:nth-child(2)  { left: 22%; animation-delay: -1.2s; animation-duration: 4.2s; height: 60px; background: linear-gradient(to bottom, transparent, rgba(230,0,18,0.7), transparent); }
.ict-data-streams span:nth-child(3)  { left: 38%; animation-delay: -2.5s; animation-duration: 3.8s; }
.ict-data-streams span:nth-child(4)  { left: 55%; animation-delay: -0.8s; animation-duration: 4.5s; height: 100px; }
.ict-data-streams span:nth-child(5)  { left: 72%; animation-delay: -3.2s; animation-duration: 3.2s; background: linear-gradient(to bottom, transparent, rgba(230,0,18,0.6), transparent); }
.ict-data-streams span:nth-child(6)  { left: 88%; animation-delay: -1.8s; animation-duration: 4s; height: 70px; }

.ict-glow-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 2;
  animation: ictOrbFloat 12s ease-in-out infinite;
}
.ict-glow-orbs span:nth-child(1) {
  width: 320px; height: 320px;
  top: 10%; left: 5%;
  background: rgba(230, 0, 18, 0.15);
  animation-delay: 0s;
}
.ict-glow-orbs span:nth-child(2) {
  width: 280px; height: 280px;
  bottom: 15%; right: 8%;
  background: rgba(34, 211, 238, 0.12);
  animation-delay: -4s;
  animation-duration: 15s;
}
.ict-glow-orbs span:nth-child(3) {
  width: 200px; height: 200px;
  top: 50%; left: 45%;
  background: rgba(59, 130, 246, 0.1);
  animation-delay: -8s;
  animation-duration: 18s;
}

.ict-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--h3c-cyan);
  box-shadow: 0 0 6px var(--h3c-cyan), 0 0 12px rgba(34, 211, 238, 0.4);
  animation: ictParticleFloat 8s ease-in-out infinite;
  z-index: 6;
}
.ict-particles span:nth-child(1)  { top: 12%; left: 8%;  animation-delay: 0s;    animation-duration: 7s; }
.ict-particles span:nth-child(2)  { top: 25%; left: 22%; animation-delay: -1s;   animation-duration: 9s; background: var(--h3c-red); box-shadow: 0 0 6px var(--h3c-red); }
.ict-particles span:nth-child(3)  { top: 18%; left: 45%; animation-delay: -2s;   animation-duration: 11s; }
.ict-particles span:nth-child(4)  { top: 35%; left: 65%; animation-delay: -3s;   animation-duration: 8s; }
.ict-particles span:nth-child(5)  { top: 55%; left: 15%; animation-delay: -4s;   animation-duration: 10s; background: var(--h3c-red); box-shadow: 0 0 6px var(--h3c-red); }
.ict-particles span:nth-child(6)  { top: 48%; left: 38%; animation-delay: -0.5s; animation-duration: 12s; width: 2px; height: 2px; }
.ict-particles span:nth-child(7)  { top: 62%; left: 52%; animation-delay: -2.5s; animation-duration: 9s; }
.ict-particles span:nth-child(8)  { top: 72%; left: 28%; animation-delay: -1.5s; animation-duration: 8s; }
.ict-particles span:nth-child(9)  { top: 78%; left: 70%; animation-delay: -3.5s; animation-duration: 11s; background: var(--h3c-red); box-shadow: 0 0 8px var(--h3c-red); }
.ict-particles span:nth-child(10) { top: 8%;  left: 78%; animation-delay: -5s;   animation-duration: 7s; }
.ict-particles span:nth-child(11) { top: 42%; left: 88%; animation-delay: -2s;   animation-duration: 10s; width: 2px; height: 2px; }
.ict-particles span:nth-child(12) { top: 68%; left: 82%; animation-delay: -4.5s; animation-duration: 9s; }
.ict-particles span:nth-child(13) { top: 85%; left: 45%; animation-delay: -1s;   animation-duration: 13s; }
.ict-particles span:nth-child(14) { top: 30%; left: 92%; animation-delay: -6s;   animation-duration: 8s; background: var(--h3c-cyan); }
.ict-particles span:nth-child(15) { top: 90%; left: 12%; animation-delay: -3s;   animation-duration: 10s; width: 4px; height: 4px; }

.ict-scan-sweep {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.04) 48%,
    rgba(34, 211, 238, 0.08) 50%,
    rgba(34, 211, 238, 0.04) 52%,
    transparent 100%
  );
  background-size: 100% 200%;
  animation: ictScanSweep 6s linear infinite;
  opacity: 0.7;
}

.ict-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 8;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.6), rgba(230, 0, 18, 0.4), transparent);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.2);
  animation: ictScanLine 8s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes ictMeshDrift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -1.5%) scale(1.05); }
}
@keyframes ictGridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}
@keyframes ictHexDrift {
  0% { background-position: 0 0; }
  100% { background-position: 56px 100px; }
}
@keyframes ictDataFall {
  0% { top: -10%; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.6; }
  100% { top: 110%; opacity: 0; }
}
@keyframes ictOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -25px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes ictScanLine {
  0%, 100% { top: -2px; opacity: 0; }
  5% { opacity: 0.6; }
  95% { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}
@keyframes ictBgKenBurns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(-1%, -0.5%); }
}
@keyframes ictParticleFloat {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  25% { transform: translate(12px, -18px) scale(1.2); opacity: 0.9; }
  50% { transform: translate(-8px, -32px) scale(0.8); opacity: 0.6; }
  75% { transform: translate(16px, -12px) scale(1.1); opacity: 1; }
}
@keyframes ictScanSweep {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}

.login-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  display: contents;
}

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

/* legacy blob bg — hidden once JS injects ict-bg */
.login-bg { display: none; }

.login-hero {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 48px clamp(24px, 6vw, 80px);
  color: white;
  pointer-events: none;
  z-index: 0;
}
.login-hero-inner {
  max-width: 520px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.h3c-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.h3c-hero-logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: min(280px, 72vw);
}
.h3c-logo-mark {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--h3c-red);
  background: white;
  padding: 8px 14px;
  border-radius: 8px;
  line-height: 1;
  box-shadow: 0 4px 24px rgba(230, 0, 18, 0.35);
}
.h3c-brand-text { display: flex; flex-direction: column; gap: 2px; }
.h3c-brand-cn { font-size: 16px; font-weight: 600; letter-spacing: 0.08em; opacity: 0.95; }
.h3c-brand-en { font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: 0.12em; text-transform: uppercase; }
.login-hero-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-hero-desc {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
}
.login-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  backdrop-filter: blur(8px);
}
.hero-tag i { color: var(--h3c-red); font-size: 11px; }
.login-hero-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hero-stat-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--h3c-red);
  line-height: 1;
  text-shadow: 0 0 40px rgba(230, 0, 18, 0.4);
}
.hero-stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}
.login-hero-slogan {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.2em;
}

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(440px, calc(100vw - 48px));
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(8, 16, 32, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.logo-icon {
  width: 64px; height: 64px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #059669, #0D9488);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: white;
  box-shadow: 0 8px 24px rgba(5,150,105,0.35);
}
.logo-icon.h3c-icon {
  background: linear-gradient(135deg, var(--h3c-red), var(--h3c-red-dark));
  box-shadow: 0 8px 28px rgba(230, 0, 18, 0.45);
}
.logo-title { font-size: 22px; font-weight: 700; color: #fff; }
.logo-subtitle { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { margin-bottom: 0; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.7); margin-bottom: 7px; }
.form-label i { margin-right: 5px; color: var(--h3c-red); }
.form-input {
  width: 100%; padding: 11px 15px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md); font-size: 14px;
  transition: var(--transition);
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.form-input::placeholder { color: rgba(255,255,255,0.35); }
.form-input:focus { outline: none; border-color: var(--h3c-red); box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.2); background: rgba(255,255,255,0.12); }
.input-wrapper { position: relative; }
.toggle-pwd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: rgba(255,255,255,0.4); }
.role-select-group .role-cards { display: flex; gap: 8px; }
.role-card {
  flex: 1; padding: 12px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md); text-align: center;
  cursor: pointer; transition: var(--transition); font-size: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
}
.role-card i { display: block; font-size: 18px; margin-bottom: 4px; color: rgba(255,255,255,0.4); }
.role-card.active { border-color: var(--h3c-red); background: rgba(230, 0, 18, 0.15); color: #fff; }
.role-card.active i { color: var(--h3c-red); }
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--h3c-red), var(--h3c-red-dark));
  color: white; border: none; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 20px rgba(230, 0, 18, 0.35);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(230, 0, 18, 0.5); }
.login-footer { text-align: center; margin-top: 22px; font-size: 12px; color: rgba(255,255,255,0.35); }
.login-page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 90;
  text-align: center;
  font-size: 12px;
  pointer-events: none;
}
.login-page-footer a {
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
}
.login-page-footer a:hover {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
}

@media (min-width: 1025px) and (max-width: 1280px) {
  .login-hero { display: none; }
}

@media (max-width: 1024px) {
  .login-shell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 16px;
    gap: 0;
  }
  .login-hero {
    position: relative;
    inset: auto;
    justify-content: center;
    padding: 40px 24px 24px;
    text-align: center;
    pointer-events: auto;
  }
  .login-hero-inner { max-width: none; margin: 0 auto; }
  .h3c-brand { justify-content: center; margin-bottom: 24px; }
  .login-hero-tags { justify-content: center; }
  .login-hero-stats { justify-content: center; gap: 24px; }
  .login-hero-slogan { text-align: center; }
  .login-panel {
    padding: 0 0 32px;
    background: none;
  }
  .login-card {
    background: rgba(8, 16, 32, 0.72);
  }
}

@media (max-width: 768px) {
  .login-h3c-logo {
    top: 16px;
    right: 16px;
  }
  .login-h3c-logo-img { height: 40px; max-width: 160px; }
  .login-hero { padding: 32px 16px 20px; }
  .login-hero-title { font-size: 24px; }
  .login-hero-desc { font-size: 13px; }
  .login-hero-stats { gap: 16px; padding: 16px 0; }
  .hero-stat-val { font-size: 26px; }
  .hero-tag { font-size: 11px; padding: 6px 12px; }
  .login-card { padding: 28px 22px; }
  .login-page-footer { bottom: 10px; font-size: 11px; }
  .logo-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .login-shell { padding: 0 12px; }
  .login-card { padding: 24px 18px; }
  .h3c-logo-mark { font-size: 22px; padding: 6px 12px; }
  .login-hero-stats { flex-wrap: wrap; gap: 12px 24px; }
}

/* App Layout */
.app-body { background: var(--gray-50); min-height: 100vh; }
#app-root { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: white; border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: var(--transition); }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-header { padding: 20px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-100); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; overflow: hidden; min-width: 0; }
.logo-icon-sm { width: 36px; height: 36px; background: linear-gradient(135deg, #059669, #0D9488); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; flex-shrink: 0; }
.sidebar-title { font-size: 15px; font-weight: 700; color: var(--gray-800); white-space: nowrap; letter-spacing: 0.02em; }
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; margin: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 8px; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 6px;
  padding: 12px 6px;
}
.sidebar.collapsed .sidebar-logo { gap: 0; justify-content: center; }
.sidebar.collapsed .logo-icon-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
  border-radius: 7px;
}
.sidebar.collapsed .sidebar-toggle {
  margin-left: 0;
  padding: 4px;
  font-size: 13px;
  line-height: 1;
}
.sidebar.collapsed .nav-item i { font-size: 14px; width: 16px; }
.sidebar.collapsed .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.sidebar.collapsed .sidebar-footer { padding: 12px 8px; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .logout-btn { display: none; }
.sidebar-toggle { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: 6px; border-radius: var(--radius-sm); }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-title { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--gray-600); font-size: 14px; margin-bottom: 2px; transition: var(--transition); cursor: pointer; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--gray-100); color: var(--gray-800); }
.nav-item.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--gray-100); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #059669, #0D9488); color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.user-role { font-size: 11px; color: var(--gray-400); }
.logout-btn { margin-left: auto; cursor: pointer; color: var(--gray-400); padding: 6px; }
.logout-btn:hover { color: var(--danger); }
.main-wrapper { flex: 1; margin-left: var(--sidebar-width); transition: var(--transition); min-height: 100vh; }
.sidebar.collapsed + .main-wrapper { margin-left: var(--sidebar-collapsed); }
.main-content { padding: 24px 28px; max-width: 1400px; }
.main-content.customers-wide { max-width: none; padding: 24px 20px; }

/* Industry Board — 4 列 × 2 行（8 行业） */
.industry-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 8px;
}
.industry-column {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.industry-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--gray-200);
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.industry-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}
.industry-column-title i { color: var(--primary); font-size: 15px; }
.industry-column-count {
  font-size: 11px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 8px;
  border-radius: 99px;
}
.industry-column-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.industry-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 20px);
  margin: 0 10px 12px;
  padding: 9px;
  background: white;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.industry-more-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  border-style: solid;
}
.more-count {
  font-size: 11px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 99px;
}
.customer-card-compact {
  padding: 14px;
}
.customer-card-compact .customer-name { font-size: 14px; }
.customer-card-compact .customer-scores { gap: 6px; }
.customer-card-compact .tier-badge { font-size: 11px; padding: 3px 8px; }

/* Tab Bar */
.tab-bar-wrap { background: white; border-bottom: 1px solid var(--gray-200); padding: 0 16px; }
.tab-bar { display: flex; gap: 2px; overflow-x: auto; }
.tab-item { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-close { background: none; border: none; cursor: pointer; color: var(--gray-400); padding: 2px 4px; border-radius: 4px; font-size: 10px; }
.tab-close:hover { background: var(--gray-100); color: var(--danger); }

/* Page Header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.page-title i { color: var(--primary); margin-right: 8px; }
.page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.date-display { font-size: 13px; color: var(--gray-500); background: white; padding: 8px 16px; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }

/* Buttons */
.btn-primary { padding: 9px 18px; background: var(--primary); color: white; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { padding: 8px 16px; background: white; color: var(--gray-600); border: 1px solid var(--gray-200); border-radius: var(--radius-md); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-text { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; }
.btn-ghost { padding: 8px 16px; background: var(--gray-100); border: none; border-radius: var(--radius-md); cursor: pointer; font-size: 13px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); cursor: pointer; transition: var(--transition); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-emerald .stat-icon { background: #ECFDF5; color: #059669; }
.stat-blue .stat-icon { background: #EFF6FF; color: #3B82F6; }
.stat-purple .stat-icon { background: #F5F3FF; color: #8B5CF6; }
.stat-orange .stat-icon { background: #FFF7ED; color: #F97316; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-800); line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 6px; }
.badge-green { background: #ECFDF5; color: #059669; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }

/* Charts */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card, .section-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); }
.card-title { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.card-title i { color: var(--primary); margin-right: 6px; }
.chart-body { padding: 16px 20px; height: 220px; position: relative; }
.chart-legend { padding: 0 20px 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-600); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.funnel-chart { padding: 20px; }
.funnel-step { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.funnel-bar-wrap { flex: 1; }
.funnel-label { width: 100px; font-size: 13px; font-weight: 500; text-align: right; flex-shrink: 0; }
.funnel-bar { height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 12px; color: white; font-size: 13px; font-weight: 600; transition: width 0.6s ease; min-width: 60px; }
.funnel-count { margin-left: auto; }
.funnel-rate { width: 50px; font-size: 12px; color: var(--gray-400); text-align: right; flex-shrink: 0; }

.two-col-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* Todo & Activity */
.todo-list, .activity-list { padding: 8px 0; }
.todo-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--gray-50); cursor: pointer; transition: var(--transition); }
.todo-item:hover { background: var(--gray-50); }
.todo-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.todo-icon.high { background: #FEF2F2; color: #EF4444; }
.todo-icon.medium { background: #FFF7ED; color: #F97316; }
.todo-text { flex: 1; }
.todo-title { font-size: 13px; font-weight: 500; color: var(--gray-800); }
.todo-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.activity-item { display: flex; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--gray-50); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-subject { font-size: 13px; font-weight: 500; }
.activity-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* Customer Cards */
.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-input { padding: 9px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); font-size: 13px; width: 220px; }
.search-input:focus { outline: none; border-color: var(--primary); }
.mini-select { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-md); font-size: 13px; background: white; cursor: pointer; }
.view-toggle { display: flex; border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; margin-left: auto; }
.view-btn { padding: 8px 12px; background: white; border: none; cursor: pointer; color: var(--gray-400); }
.view-btn.active { background: var(--primary-bg); color: var(--primary); }

.customer-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.customer-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm); }
.customer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-light); }
.customer-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.customer-name { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.customer-code { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.tier-badge { padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.tier-S { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; }
.tier-A { background: #ECFDF5; color: #047857; }
.tier-B { background: #EFF6FF; color: #1D4ED8; }
.tier-C { background: var(--gray-100); color: var(--gray-600); }
.customer-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meta-tag { font-size: 11px; padding: 3px 8px; background: var(--gray-100); border-radius: 99px; color: var(--gray-600); }
.customer-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.score-item { font-size: 12px; }
.score-label { color: var(--gray-500); }
.score-bar { height: 6px; background: var(--gray-100); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s; }
.pipeline-stage { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--gray-500); }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

.customer-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.quick-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--gray-100); cursor: pointer; transition: var(--transition); }
.quick-card:hover { background: var(--primary-bg); border-color: var(--primary-light); }
.quick-score { font-size: 24px; font-weight: 700; color: var(--primary); width: 48px; text-align: center; }

/* Customer List View */
.customer-list-view { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.data-table tr { cursor: pointer; transition: var(--transition); }
.data-table tr:hover { background: var(--gray-50); }
.table-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.score-pill { display: inline-block; min-width: 32px; padding: 2px 8px; border-radius: 99px; background: var(--primary-bg); color: var(--primary-dark); font-weight: 700; font-size: 13px; text-align: center; }
.table-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.table-progress .score-bar { flex: 1; height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.table-progress span { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.table-contact { font-size: 12px; color: var(--gray-600); line-height: 1.45; max-width: 180px; }
.table-date { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.table-collab-item + .table-collab-item { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--gray-200); }
.industry-customer-table td.table-collab { max-width: 200px; }
.industry-customer-table th,
.industry-customer-table td { white-space: nowrap; }
.industry-customer-table td:first-child { white-space: normal; min-width: 120px; }
.industry-customer-table td.table-contact { white-space: normal; min-width: 140px; }

.industry-tabs-bar { margin-bottom: 16px; }
.industry-tabs-bar .category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.industry-tabs-bar .category-tabs::-webkit-scrollbar { display: none; }
.industry-tabs-bar .cat-tab { flex-shrink: 0; white-space: nowrap; }
.industry-tabs-bar .cat-tab .tab-count {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px;
  font-size: 11px; background: rgba(0,0,0,0.06);
}
.industry-tabs-bar .cat-tab.active .tab-count { background: rgba(255,255,255,0.25); }

.industry-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100);
  padding: 18px 22px; margin-bottom: 16px; flex-wrap: wrap;
}
.industry-summary-main { display: flex; align-items: center; gap: 14px; }
.industry-summary-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.industry-summary-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.industry-summary-desc { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.industry-summary-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.industry-summary-stat { text-align: center; min-width: 72px; }
.industry-summary-stat .val { display: block; font-size: 20px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.industry-summary-stat .lbl { display: block; font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.industry-summary-empty { width: 100%; text-align: center; color: var(--gray-500); font-size: 14px; padding: 8px 0; }
.industry-summary-empty i { margin-right: 6px; color: var(--primary); }

/* Customer Detail — Overview & Goals */
#customerDetailRoot { width: 100%; max-width: 100%; overflow-x: hidden; }
.customer-detail-header {
  width: 100%; box-sizing: border-box; overflow: hidden;
  flex-direction: column; align-items: stretch; gap: 12px;
}
.customer-detail-head-row {
  display: flex; align-items: stretch; justify-content: space-between;
  gap: 16px; width: 100%; min-width: 0;
}
.customer-detail-title-wrap { flex: 0 0 auto; min-width: 140px; max-width: 220px; }
.customer-header-brief {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 0 4px; border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200);
  padding-left: 16px; padding-right: 16px;
}
.header-brief-block { min-width: 0; }
.header-brief-label {
  font-size: 11px; font-weight: 700; color: var(--gray-500); margin-bottom: 4px;
}
.header-brief-label i { color: var(--primary); margin-right: 5px; font-size: 10px; }
.header-brief-text {
  font-size: 12px; color: var(--gray-700); line-height: 1.6; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.customer-detail-title-wrap h2 {
  font-size: 22px; font-weight: 700; margin: 0;
  line-height: 1.35; word-break: break-word;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.customer-detail-header .detail-score-ring {
  flex-shrink: 0; text-align: center; align-self: flex-start;
  padding: 10px 14px; background: var(--primary-bg);
  border-radius: var(--radius-md); min-width: 68px;
}
.customer-detail-header .detail-full-name { font-size: 14px; color: var(--gray-500); margin-top: 4px; word-break: break-word; }
.customer-detail-header .customer-tag-row { width: 100%; margin: 0; }
.customer-detail-header .detail-header-meta { width: 100%; margin-top: 0; }
.customer-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.customer-tag {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; background: var(--primary-bg); color: var(--primary-dark);
}
.customer-overview-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px;
  width: 100%; box-sizing: border-box; align-items: stretch;
}
.overview-section-label {
  font-size: 13px; font-weight: 600; color: var(--gray-500); margin-bottom: 8px;
}
.overview-section-label i { color: var(--primary); margin-right: 6px; }
.overview-card {
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  overflow: hidden; min-height: 0; height: 100%;
}
.overview-card--it { border-top: 2px solid #3b82f6; }
.overview-card--demand { border-top: 2px solid #f59e0b; }
.overview-card--decision { border-top: 2px solid #8b5cf6; }
.overview-card--value { border-top: 2px solid var(--primary); }
.overview-card-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 12px 6px; border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.overview-card-head { font-size: 12px; font-weight: 700; color: var(--gray-700); min-width: 0; }
.overview-card-head i { color: var(--primary); margin-right: 6px; width: 14px; text-align: center; }
.overview-score-pill {
  flex-shrink: 0; font-size: 14px; font-weight: 800; color: var(--primary);
  background: white; border: 1px solid var(--gray-200); border-radius: 99px;
  padding: 1px 8px; line-height: 1.35;
}
.overview-score-pill small { font-size: 10px; font-weight: 600; color: var(--gray-400); margin-left: 1px; }
.overview-highlight {
  padding: 5px 12px; font-size: 11px; font-weight: 600; color: var(--gray-800);
  background: white; border-bottom: 1px dashed var(--gray-100); line-height: 1.4;
  word-break: break-word;
}
.overview-card-body { padding: 7px 12px 9px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.overview-field { font-size: 11px; line-height: 1.35; }
.overview-field.full .overview-field-value { margin-top: 2px; }
.overview-field-label { display: block; font-size: 10px; font-weight: 600; color: var(--gray-400); margin-bottom: 1px; }
.overview-field-value { display: block; color: var(--gray-700); font-weight: 500; word-break: break-word; }
.overview-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.overview-mini-stat {
  background: var(--gray-50); border-radius: var(--radius-sm); padding: 5px 4px;
  text-align: center; border: 1px solid var(--gray-100);
}
.overview-mini-stat .oms-val { display: block; font-size: 13px; font-weight: 800; color: var(--primary-dark); line-height: 1.15; }
.overview-mini-stat .oms-lbl { display: block; font-size: 9px; color: var(--gray-500); margin-top: 1px; }
.info-empty { font-size: 11px; color: var(--gray-400); padding: 2px 0; }
.overview-card--decision .overview-highlight { padding: 4px 10px; font-size: 10px; line-height: 1.35; }
.overview-card--decision .overview-card-body { padding: 5px 10px 7px; gap: 2px; }
.chain-compact-list { display: flex; flex-direction: column; gap: 3px; }
.chain-compact-row {
  display: flex; align-items: flex-start; gap: 5px; line-height: 1.3; min-width: 0;
}
.chain-compact-role {
  flex-shrink: 0; font-size: 9px; font-weight: 700; padding: 0 4px; border-radius: 3px;
  background: var(--gray-100); color: var(--gray-600); line-height: 1.5; margin-top: 1px;
}
.chain-compact-line {
  flex: 1; min-width: 0; font-size: 10px; color: var(--gray-700);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chain-compact-line strong { font-size: 11px; font-weight: 700; color: var(--gray-800); }
.chain-compact-meta { color: var(--gray-500); font-weight: 400; }
.chain-compact-more { font-size: 9px; color: var(--gray-400); text-align: right; line-height: 1.2; padding-top: 1px; }

.customer-goals-section {
  background: white; border: 1px solid var(--gray-100); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
  width: 100%; box-sizing: border-box;
}
.goals-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.goals-section-head h3 { font-size: 17px; font-weight: 700; color: var(--gray-800); margin: 0; }
.goals-section-head h3 i { color: var(--primary); margin-right: 8px; }
.goals-section-tip { font-size: 12px; color: var(--gray-400); }
.overall-goal-card {
  background: linear-gradient(135deg, var(--primary-bg), #f0fdf4);
  border: 1px solid rgba(5, 150, 105, 0.15); border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 20px;
}
.overall-goal-label { font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: 0.5px; }
.overall-goal-title { font-size: 18px; font-weight: 700; color: var(--gray-900); margin: 6px 0 4px; }
.overall-goal-desc { font-size: 13px; color: var(--gray-600); line-height: 1.55; }
.sub-goal-block { margin-bottom: 22px; }
.sub-goal-block:last-child { margin-bottom: 0; }
.sub-goal-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--gray-100); }
.sub-goal-head h4 { font-size: 15px; font-weight: 700; color: var(--gray-800); margin: 0 0 4px; }
.sub-goal-head h4 i { color: var(--accent); margin-right: 6px; }
.sub-goal-head p { font-size: 12px; color: var(--gray-500); margin: 0; line-height: 1.5; }

.goal-task-list { display: flex; flex-direction: column; gap: 12px; }
.goal-task-card {
  border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 14px 16px;
  background: var(--gray-50); transition: var(--transition);
}
.goal-task-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.goal-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.goal-task-phase {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: white; color: var(--gray-600); border: 1px solid var(--gray-200); margin-bottom: 6px;
}
.goal-task-title { font-size: 14px; font-weight: 700; color: var(--gray-800); margin: 0; line-height: 1.4; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.goal-task-update-btn { flex-shrink: 0; white-space: nowrap; }
.goal-task-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.goal-progress-bar { flex: 1; height: 8px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.goal-progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.4s ease; }
.goal-progress-fill.pending { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.goal-progress-fill.active { background: linear-gradient(90deg, var(--primary), #34d399); }
.goal-progress-fill.done { background: linear-gradient(90deg, #059669, #10b981); }
.goal-progress-pct { font-size: 13px; font-weight: 700; color: var(--primary-dark); min-width: 36px; text-align: right; }
.goal-task-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.goal-task-meta { font-size: 12px; line-height: 1.45; }
.goal-task-meta .gk { display: block; font-size: 10px; font-weight: 600; color: var(--gray-400); margin-bottom: 2px; }
.goal-task-meta .gv { color: var(--gray-700); word-break: break-word; }
.goal-collab-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.goal-collab-chip {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: white; border: 1px solid var(--gray-200); color: var(--gray-600);
}
.goal-task-latest {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--gray-200); font-size: 12px;
}
.goal-task-latest .gk { font-size: 10px; font-weight: 600; color: var(--gray-400); }
.goal-task-latest p { margin: 4px 0; color: var(--gray-700); line-height: 1.5; }
.goal-log-meta { font-size: 11px; color: var(--gray-400); }

.goal-task-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.btn-link-sm {
  border: none; background: none; padding: 0; font-size: 11px; font-weight: 600;
  color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.btn-link-sm:hover { color: var(--primary-dark); text-decoration: underline; }
.btn-link-sm.danger { color: var(--danger); }
.btn-icon-sm {
  border: none; background: var(--gray-100); color: var(--gray-500); width: 28px; height: 28px;
  border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0;
}
.btn-icon-sm:hover { background: var(--gray-200); color: var(--danger); }

.goal-task-milestones {
  margin-bottom: 12px; padding: 10px 12px; background: var(--gray-50);
  border: 1px dashed var(--gray-200); border-radius: var(--radius-sm);
}
.goal-task-milestones.empty { padding-bottom: 8px; }
.goal-milestones-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.goal-milestones-head .gk { font-size: 11px; font-weight: 700; color: var(--gray-600); }
.goal-milestones-head .gk i { color: var(--primary); margin-right: 4px; }
.goal-milestone-item { padding: 6px 0; border-bottom: 1px dashed var(--gray-200); }
.goal-milestone-item:last-child { border-bottom: none; padding-bottom: 0; }
.goal-milestone-item.done .goal-milestone-title { color: var(--primary-dark); }
.goal-milestone-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.goal-milestone-title { font-size: 12px; font-weight: 700; color: var(--gray-800); flex: 1; min-width: 0; }
.goal-milestone-due { font-size: 10px; color: var(--gray-400); }
.goal-milestone-pct { font-size: 11px; font-weight: 700; color: var(--primary); }
.goal-metric-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 11px; }
.goal-metric-row:last-child { margin-bottom: 0; }
.goal-metric-name { flex: 0 0 88px; color: var(--gray-600); font-size: 10px; line-height: 1.3; }
.goal-metric-bar { flex: 1; height: 5px; background: var(--gray-200); border-radius: 99px; overflow: hidden; min-width: 40px; }
.goal-metric-val { flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--gray-700); min-width: 52px; text-align: right; }

.goal-milestone-modal { max-width: 680px; }
.goal-milestone-tip { font-size: 12px; color: var(--gray-500); margin: 0 0 14px; line-height: 1.5; }
.milestone-editor-block {
  padding: 14px; margin-bottom: 12px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: var(--radius-md);
}
.milestone-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.milestone-editor-num { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.milestone-metrics-editor { margin-top: 4px; }
.milestone-metrics-label { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.metric-editor-head {
  display: grid; grid-template-columns: 1.4fr 0.6fr 0.7fr 0.7fr 28px; gap: 6px;
  font-size: 10px; font-weight: 600; color: var(--gray-400); margin-bottom: 4px; padding: 0 2px;
}
.metric-editor-row {
  display: grid; grid-template-columns: 1.4fr 0.6fr 0.7fr 0.7fr 28px; gap: 6px; margin-bottom: 6px; align-items: center;
}
.metric-editor-row .search-input { padding: 6px 8px; font-size: 12px; }
.goal-add-milestone-btn { margin-top: 4px; }

.goal-milestone-metrics-form {
  margin-bottom: 16px; padding: 14px; background: #f0fdf4; border: 1px solid rgba(5,150,105,0.15);
  border-radius: var(--radius-md);
}
.goal-milestone-metrics-form h4 { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--gray-800); }
.goal-milestone-metrics-form h4 i { color: var(--primary); margin-right: 6px; }
.goal-modal-milestone { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed rgba(5,150,105,0.15); }
.goal-modal-milestone:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.goal-modal-ms-title { font-size: 12px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.goal-metric-update-row { margin-bottom: 8px; }
.goal-metric-update-row:last-child { margin-bottom: 0; }
.goal-metric-update-inputs { display: flex; align-items: center; gap: 8px; }
.goal-metric-update-input { max-width: 120px; }
.goal-metric-target { font-size: 12px; color: var(--gray-500); }
.goal-metric-unit { font-weight: 400; color: var(--gray-400); }

.goal-task-modal { max-width: 640px; }
.goal-modal-summary { margin-bottom: 20px; }
.goal-progress-form { margin-bottom: 20px; padding: 16px; background: var(--gray-50); border-radius: var(--radius-md); }
.goal-progress-form h4 { font-size: 14px; font-weight: 700; margin: 0 0 12px; color: var(--gray-800); }
.goal-progress-form h4 i { color: var(--primary); margin-right: 6px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-row .req { color: var(--danger); }
.goal-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  font-size: 13px; font-family: inherit; resize: vertical; min-height: 88px;
}
.goal-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.goal-progress-history h4 { font-size: 14px; font-weight: 700; margin: 0 0 12px; color: var(--gray-800); }
.goal-progress-history h4 i { color: var(--gray-400); margin-right: 6px; }
.goal-log-item {
  padding: 12px 14px; border: 1px solid var(--gray-100); border-radius: var(--radius-md);
  margin-bottom: 8px; background: white;
}
.goal-log-content { font-size: 13px; color: var(--gray-800); line-height: 1.55; margin-bottom: 8px; }
.goal-log-meta-grid { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--gray-400); }
.goal-log-meta-grid i { width: 14px; margin-right: 4px; }

/* Customer Detail */
.detail-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); cursor: pointer; margin-bottom: 16px; background: none; border: none; }
.detail-back:hover { color: var(--primary); }
.detail-header { background: white; border-radius: var(--radius-lg); padding: 24px; border: 1px solid var(--gray-100); margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.detail-header-left h2 { font-size: 22px; font-weight: 700; }
.detail-header-meta { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--gray-500); flex-wrap: wrap; }
.detail-score-ring { text-align: center; }
.score-ring-value { font-size: 36px; font-weight: 700; color: var(--primary); }
.score-ring-label { font-size: 12px; color: var(--gray-500); }

.pipeline-stepper { display: flex; align-items: center; background: white; border-radius: var(--radius-lg); padding: 20px 24px; border: 1px solid var(--gray-100); margin-bottom: 20px; overflow-x: auto; }
.step-item { display: flex; align-items: center; flex: 1; min-width: 140px; }
.step-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; border: 2px solid var(--gray-200); background: white; flex-shrink: 0; transition: var(--transition); }
.step-item.done .step-circle { background: var(--primary); border-color: var(--primary); color: white; }
.step-item.active .step-circle { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(5,150,105,0.15); }
.step-info { margin-left: 10px; }
.step-label { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.step-progress { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.step-line { flex: 1; height: 2px; background: var(--gray-200); margin: 0 12px; min-width: 20px; }
.step-item.done + .step-line, .step-line.done { background: var(--primary); }

.detail-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: white; padding: 6px; border-radius: var(--radius-md); border: 1px solid var(--gray-100); width: fit-content; }
.detail-tab { padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; border: none; background: none; color: var(--gray-500); transition: var(--transition); }
.detail-tab.active { background: var(--primary); color: white; font-weight: 600; }
.detail-tab i { margin-right: 6px; }

/* Customer progress timeline */
.progress-timeline { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px 24px; }
.progress-timeline-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--gray-100); }
.progress-timeline-stat { font-size: 13px; color: var(--gray-500); }
.progress-timeline-stat strong { color: var(--gray-800); font-weight: 700; }
.progress-timeline-stat.key-stat { color: var(--primary-dark); background: var(--primary-bg); padding: 4px 12px; border-radius: 99px; font-size: 12px; }
.progress-timeline-stat i { margin-right: 6px; }
.progress-timeline-track { padding: 4px 0 0; }

.timeline-month { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px 44px; }
.timeline-month span { font-size: 12px; font-weight: 600; color: var(--gray-600); background: var(--gray-50); padding: 4px 12px; border-radius: 99px; white-space: nowrap; }
.timeline-month::after { content: ''; flex: 1; height: 1px; background: var(--gray-100); }

.timeline-node { display: flex; gap: 16px; cursor: pointer; }
.timeline-node:last-child .timeline-line { display: none; }
.timeline-axis { display: flex; flex-direction: column; align-items: center; width: 28px; flex-shrink: 0; padding-top: 6px; }
.timeline-dot {
  width: 12px; height: 12px; border-radius: 50%; background: white;
  border: 2px solid var(--gray-300); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1; transition: var(--transition);
}
.timeline-dot i { display: none; }
.timeline-node.is-key .timeline-dot {
  width: 28px; height: 28px; border: 3px solid var(--primary); background: var(--primary-bg);
  box-shadow: 0 0 0 4px rgba(5,150,105,0.12);
}
.timeline-node.is-key .timeline-dot i { display: block; font-size: 10px; color: var(--primary); }
.timeline-line { flex: 1; width: 2px; background: linear-gradient(to bottom, var(--gray-200), var(--gray-100)); min-height: 20px; margin: 6px 0; }
.timeline-node.is-key .timeline-line { background: linear-gradient(to bottom, rgba(5,150,105,0.35), var(--gray-100)); }

.timeline-card {
  flex: 1; background: #FAFBFC; border: 1px solid var(--gray-100); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 16px; transition: var(--transition);
}
.timeline-node.is-key .timeline-card {
  background: #FAFFFE; border-color: #A7F3D0; border-left: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(5,150,105,0.08);
}
.timeline-node:hover .timeline-card { box-shadow: var(--shadow-sm); border-color: var(--gray-200); }
.timeline-node.is-key:hover .timeline-card { border-color: var(--primary); }

.timeline-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.timeline-date { font-size: 12px; font-weight: 600; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.timeline-type-chip {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  border-left: none;
}
.timeline-type-chip.visit { background: #EFF6FF; color: #1D4ED8; }
.timeline-type-chip.call { background: #F5F3FF; color: #6D28D9; }
.timeline-type-chip.demo { background: #ECFDF5; color: #047857; }
.timeline-type-chip.poc { background: #FFF7ED; color: #C2410C; }
.timeline-type-chip.negotiation { background: #FEF2F2; color: #B91C1C; }
.timeline-type-chip.satisfaction { background: #F0FDFA; color: #0F766E; }
.timeline-stage-chip { font-size: 10px; color: var(--gray-500); background: var(--gray-50); padding: 2px 8px; border-radius: 99px; }
.timeline-key-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  background: var(--primary); color: white; margin-left: auto;
}
.timeline-key-badge i { margin-right: 4px; font-size: 9px; }
.timeline-subject { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; }
.timeline-content { font-size: 13px; color: var(--gray-600); line-height: 1.5; margin-bottom: 10px; }
.timeline-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--gray-400); }
.timeline-meta i { margin-right: 4px; }
.timeline-outcome { font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-panel { display: flex; flex-direction: column; gap: 16px; }
.profile-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: white; border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 18px 22px;
}
.profile-completeness { display: flex; align-items: center; gap: 16px; }
.completeness-ring { width: 64px; height: 64px; }
.completeness-ring svg { width: 100%; height: 100%; }
.completeness-bg { fill: none; stroke: var(--gray-100); stroke-width: 3; }
.completeness-fill { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; }
.completeness-text { fill: var(--gray-800); font-size: 9px; font-weight: 700; text-anchor: middle; }
.completeness-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.completeness-desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.profile-dim-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-dim-pill {
  display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 10px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--gray-100); background: #FAFBFC;
}
.profile-dim-pill .pill-label { font-size: 11px; color: var(--gray-500); margin-bottom: 4px; }
.profile-dim-pill .pill-score { font-size: 20px; font-weight: 800; line-height: 1; }
.profile-dim-pill.dim-it { border-top: 3px solid #3B82F6; }
.profile-dim-pill.dim-it .pill-score { color: #1D4ED8; }
.profile-dim-pill.dim-demand { border-top: 3px solid #8B5CF6; }
.profile-dim-pill.dim-demand .pill-score { color: #6D28D9; }
.profile-dim-pill.dim-decision { border-top: 3px solid #F59E0B; }
.profile-dim-pill.dim-decision .pill-score { color: #B45309; }
.profile-dim-pill.dim-value { border-top: 3px solid var(--primary); }
.profile-dim-pill.dim-value .pill-score { color: var(--primary-dark); }

.profile-grid { margin-top: 0; }
.profile-dimension { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px; }
.dim-card {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100);
  padding: 18px 20px; transition: var(--transition); overflow: hidden;
}
.dim-card:hover { box-shadow: var(--shadow-sm); border-color: var(--gray-200); }
.dim-card.dim-it { border-top: 3px solid #3B82F6; }
.dim-card.dim-demand { border-top: 3px solid #8B5CF6; }
.dim-card.dim-decision { border-top: 3px solid #F59E0B; }
.dim-card.dim-value { border-top: 3px solid var(--primary); }
.dim-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dim-card-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dim-it .dim-card-icon { background: #EFF6FF; color: #1D4ED8; }
.dim-demand .dim-card-icon { background: #F5F3FF; color: #6D28D9; }
.dim-decision .dim-card-icon { background: #FFFBEB; color: #B45309; }
.dim-value .dim-card-icon { background: var(--primary-bg); color: var(--primary-dark); }
.dim-card-meta { flex: 1; min-width: 0; }
.dim-card-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.dim-card-level { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.dim-level-excellent .dim-card-level { color: var(--primary); font-weight: 600; }
.dim-score-badge { text-align: right; flex-shrink: 0; }
.dim-score-badge span { font-size: 26px; font-weight: 800; color: var(--gray-800); line-height: 1; }
.dim-score-badge small { font-size: 11px; color: var(--gray-400); margin-left: 2px; }
.dim-it .dim-score-badge span { color: #1D4ED8; }
.dim-demand .dim-score-badge span { color: #6D28D9; }
.dim-decision .dim-score-badge span { color: #B45309; }
.dim-value .dim-score-badge span { color: var(--primary-dark); }
.dim-progress { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.dim-progress-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.dim-it .dim-progress-fill { background: linear-gradient(90deg, #93C5FD, #3B82F6); }
.dim-demand .dim-progress-fill { background: linear-gradient(90deg, #C4B5FD, #8B5CF6); }
.dim-decision .dim-progress-fill { background: linear-gradient(90deg, #FCD34D, #F59E0B); }
.dim-value .dim-progress-fill { background: linear-gradient(90deg, #6EE7B7, var(--primary)); }
.dim-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dim-title { font-size: 15px; font-weight: 600; }
.dim-title i { color: var(--primary); margin-right: 8px; }
.dim-score { font-size: 20px; font-weight: 700; color: var(--primary); }
.dim-fields { display: flex; flex-direction: column; gap: 0; }
.dim-field {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  font-size: 13px; padding: 10px 0; border-bottom: 1px dashed #EEF0F3;
}
.dim-field:last-child { border-bottom: none; padding-bottom: 0; }
.dim-field-wide { flex-direction: column; gap: 6px; }
.dim-field-wide .dim-field-value { text-align: left; max-width: 100%; line-height: 1.5; }
.dim-field-label { color: var(--gray-500); flex-shrink: 0; font-size: 12px; }
.dim-field-value { color: var(--gray-800); font-weight: 500; text-align: right; max-width: 62%; line-height: 1.4; }
.radar-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px; grid-column: span 2; }
.radar-card-head { margin-bottom: 12px; }
.radar-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.radar-layout-split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 24px; align-items: stretch; }
.radar-left { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 12px; }
.radar-wrap { width: 260px; height: 260px; flex-shrink: 0; }
.radar-scores { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.radar-score-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.radar-score-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.radar-score-row.dim-it .radar-score-dot { background: #3B82F6; }
.radar-score-row.dim-demand .radar-score-dot { background: #8B5CF6; }
.radar-score-row.dim-decision .radar-score-dot { background: #F59E0B; }
.radar-score-row.dim-value .radar-score-dot { background: var(--primary); }
.radar-score-label { width: 56px; color: var(--gray-600); flex-shrink: 0; }
.radar-score-bar { flex: 1; height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.radar-score-fill { height: 100%; border-radius: 99px; }
.radar-score-row.dim-it .radar-score-fill { background: linear-gradient(90deg, #93C5FD, #3B82F6); }
.radar-score-row.dim-demand .radar-score-fill { background: linear-gradient(90deg, #C4B5FD, #8B5CF6); }
.radar-score-row.dim-decision .radar-score-fill { background: linear-gradient(90deg, #FCD34D, #F59E0B); }
.radar-score-row.dim-value .radar-score-fill { background: linear-gradient(90deg, #6EE7B7, var(--primary)); }
.radar-score-val { width: 28px; text-align: right; font-weight: 800; color: var(--gray-800); flex-shrink: 0; }
.radar-score-row.dim-it .radar-score-val { color: #1D4ED8; }
.radar-score-row.dim-demand .radar-score-val { color: #6D28D9; }
.radar-score-row.dim-decision .radar-score-val { color: #B45309; }
.radar-score-row.dim-value .radar-score-val { color: var(--primary-dark); }

.radar-insights {
  background: linear-gradient(180deg, #FAFFFE 0%, #F8FAFC 100%);
  border: 1px solid #E8F5F0; border-radius: var(--radius-md); padding: 18px 20px;
  display: flex; flex-direction: column;
}
.insights-head { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #E8F5F0; }
.insights-head i { color: #F59E0B; margin-right: 8px; }
.insight-list { display: flex; flex-direction: column; gap: 0; flex: 1; }
.insight-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #E8ECF0; }
.insight-item:last-child { border-bottom: none; padding-bottom: 0; }
.insight-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
}
.insight-highlight .insight-icon { background: #FFFBEB; color: #B45309; }
.insight-strength .insight-icon { background: #ECFDF5; color: var(--primary); }
.insight-weakness .insight-icon { background: #EFF6FF; color: #1D4ED8; }
.insight-opportunity .insight-icon { background: #F5F3FF; color: #6D28D9; }
.insight-action .insight-icon { background: var(--gray-100); color: var(--gray-600); }
.insight-warn .insight-icon { background: #FEF2F2; color: #B91C1C; }
.insight-title { font-size: 13px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.insight-text { font-size: 12px; color: var(--gray-600); line-height: 1.6; }

.match-list { display: flex; flex-direction: column; gap: 12px; }
.match-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 16px 20px; display: flex; align-items: center; gap: 16px; }
.match-score { font-size: 24px; font-weight: 700; color: var(--primary); width: 56px; text-align: center; }
.match-status { padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.status-accepted { background: #ECFDF5; color: #047857; }
.status-recommended { background: #EFF6FF; color: #1D4ED8; }

.contact-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: white; border-radius: var(--radius-md); border: 1px solid var(--gray-100); margin-bottom: 8px; }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; }

.contacts-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.contacts-section { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px; }
.contacts-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.contacts-section-head h3 { font-size: 15px; font-weight: 600; color: var(--gray-800); margin: 0; }
.contacts-section-head h3 i { color: var(--primary); margin-right: 8px; }
.contacts-section-tip { font-size: 11px; color: var(--gray-400); }
.backend-head { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-100); }

.decision-chain { display: flex; flex-direction: column; align-items: center; }
.chain-step { display: flex; flex-direction: column; align-items: center; width: 100%; }
.chain-card {
  width: 100%; max-width: 360px; background: #FAFBFC; border: 1px solid var(--gray-100);
  border-radius: var(--radius-md); padding: 14px 16px; transition: var(--transition);
}
.chain-card.chain-final { border-color: #FCD34D; background: #FFFBEB; border-left: 3px solid #F59E0B; }
.chain-card.chain-primary { border-color: #A7F3D0; background: #FAFFFE; border-left: 3px solid var(--primary); }
.chain-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.chain-role-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gray-100); color: var(--gray-600); }
.chain-card.chain-final .chain-role-badge { background: #FEF3C7; color: #B45309; }
.chain-influence { font-size: 10px; color: var(--gray-400); margin-left: auto; }
.chain-influence.influence-high { color: var(--primary); font-weight: 600; }
.chain-name { font-size: 16px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.chain-title { font-size: 12px; color: var(--gray-500); margin-bottom: 8px; }
.chain-phone { font-size: 12px; color: var(--gray-400); }
.chain-phone i { margin-right: 6px; }
.chain-connector { color: var(--gray-300); padding: 6px 0; font-size: 12px; }

.interface-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.interface-block { background: #FAFBFC; border: 1px solid var(--gray-100); border-radius: var(--radius-md); padding: 12px; }
.interface-block-full { margin-top: 0; }
.interface-block-label { font-size: 11px; font-weight: 600; color: var(--gray-500); margin-bottom: 10px; }
.interface-block-label i { margin-right: 6px; color: var(--primary); }
.interface-person { display: flex; gap: 12px; align-items: flex-start; }
.interface-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.interface-name { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.interface-title { font-size: 12px; font-weight: 500; color: var(--gray-500); }
.interface-meta { font-size: 11px; color: var(--gray-500); margin-top: 4px; }
.interface-meta i { width: 14px; margin-right: 4px; color: var(--gray-400); }
.interface-contact { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--gray-400); }
.interface-contact i { width: 14px; margin-right: 4px; }
.interface-empty { font-size: 12px; color: var(--gray-400); padding: 8px 0; }

@media (max-width: 960px) {
  .contacts-layout { grid-template-columns: 1fr; }
  .interface-grid { grid-template-columns: 1fr; }
}

/* Solutions */
.category-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tab { padding: 7px 14px; border: 1px solid var(--gray-200); border-radius: 99px; font-size: 13px; cursor: pointer; background: white; transition: var(--transition); }
.cat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.solution-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.solution-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); padding: 20px; transition: var(--transition); }
.solution-card:hover { box-shadow: var(--shadow-md); }
.sol-category { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.sol-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.sol-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; margin-bottom: 12px; }
.sol-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sol-tag { font-size: 11px; padding: 2px 8px; background: var(--gray-100); border-radius: 99px; color: var(--gray-600); }

/* Activity Timeline Matrix — 每行一个行业 */
.activity-industry-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.activity-industry-panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  width: 100%;
}
.activity-industry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}
.activity-industry-header i { color: var(--primary); }
.activity-industry-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
}
.activity-industry-empty { min-height: 120px; }
.activity-more-btn {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}
.activity-empty-tip {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-400);
}
.activity-matrix-wrap {
  overflow-x: auto;
  padding: 0 0 8px;
}
.activity-matrix {
  min-width: 100%;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
}
.activity-matrix col.col-customer { width: 120px; }
.activity-matrix col.col-tasks { width: 108px; }
.activity-matrix col.col-recent { width: 168px; }
.activity-matrix col.col-normal { width: 96px; }
.activity-matrix-head {
  background: var(--gray-50);
}
.activity-matrix-row.activity-matrix-head th {
  border-bottom: 1px solid #E8EAED;
  vertical-align: middle;
}
.activity-matrix-customer,
.activity-matrix-tasks,
.activity-matrix-month,
.activity-matrix-cell {
  vertical-align: top;
  padding: 8px 6px;
  box-sizing: border-box;
}
.activity-matrix-row.task-row td.activity-matrix-tasks,
.activity-matrix-row.task-row td.activity-matrix-cell {
  border-bottom: 1px dashed #E8ECF0;
}
.activity-matrix-row.task-row td.activity-matrix-tasks {
  vertical-align: middle;
}
.activity-matrix-row.customer-group-end td.activity-matrix-tasks,
.activity-matrix-row.customer-group-end td.activity-matrix-cell {
  border-bottom: 1px solid #E8EAED;
}
.activity-matrix-tasks {
  background: #FAFBFC;
  border-right: 1px solid var(--gray-200);
  text-align: center;
}
.task-cell-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}
.activity-matrix-tasks.head {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  vertical-align: middle;
  text-align: center;
  background: var(--gray-50);
}
.task-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.task-tag {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  font-size: 10px;
  line-height: 1.35;
  padding: 4px 6px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  word-break: break-word;
  text-align: center;
}
.task-tag.task-in_progress {
  border-left-color: var(--primary);
  background: #ECFDF5;
  color: #047857;
}
.task-tag.task-pending {
  border-left-color: #F59E0B;
  background: #FFFBEB;
  color: #B45309;
}
.task-tag.task-done {
  border-left-color: var(--gray-400);
  background: var(--gray-50);
  color: var(--gray-500);
  text-decoration: line-through;
  opacity: 0.85;
}
.task-tag.task-clickable {
  cursor: pointer;
  transition: var(--transition);
}
.task-tag.task-clickable:hover {
  box-shadow: var(--shadow-sm);
  filter: brightness(0.98);
}
.task-status-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.task-status-tag.task-in_progress { background: #ECFDF5; color: #047857; }
.task-status-tag.task-pending { background: #FFFBEB; color: #B45309; }
.task-status-tag.task-done { background: var(--gray-100); color: var(--gray-500); }
.task-empty {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--gray-300);
}
.activity-matrix-month.month-col,
.activity-matrix-cell.month-col {
  border-right: 1px solid var(--gray-200);
}
.activity-matrix-month.month-col-last,
.activity-matrix-cell.month-col-last {
  border-right: none;
}
.activity-matrix-customer {
  width: 120px;
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
  border-right: 1px solid var(--gray-200);
  text-align: center;
  vertical-align: middle;
  box-shadow: inset 0 -1px 0 #E8EAED;
}
.customer-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.activity-matrix-customer.head {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: default;
  text-align: center;
  box-shadow: none;
  background: var(--gray-50);
}
.customer-row-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}
.customer-row-name:hover {
  color: var(--primary);
  text-decoration: underline;
}
.activity-matrix-customer .tier-badge {
  font-size: 10px;
  padding: 2px 6px;
  display: inline-block;
}
.activity-matrix-month {
  text-align: center;
  background: var(--gray-50);
  vertical-align: middle;
  font-weight: normal;
}
.activity-matrix-month.month-recent {
  background: #F8FAFC;
}
.activity-matrix-month.month-recent .month-num {
  color: var(--gray-800);
}
.month-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.activity-matrix-cell {
  min-height: 36px;
  background: white;
  overflow: hidden;
}
.activity-matrix-cell.month-recent {
  background: #FAFCFB;
}
.activity-matrix-cell.month-recent.has-activity {
  background: #F0FDF9;
}
.activity-chip {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  border-left: 3px solid transparent;
  line-height: 1.3;
  transition: var(--transition);
}
.activity-chip:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.activity-chip .chip-type { font-weight: 700; display: block; }
.activity-matrix-cell.has-activity {
  background: #FAFFFE;
}
.activity-chip .chip-subject {
  display: block;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.activity-matrix-cell.month-recent .activity-chip .chip-subject {
  max-width: 152px;
}
.activity-chip.visit { background: #EFF6FF; border-left-color: #3B82F6; color: #1D4ED8; }
.activity-chip.call { background: #F5F3FF; border-left-color: #8B5CF6; color: #6D28D9; }
.activity-chip.demo { background: #ECFDF5; border-left-color: #059669; color: #047857; }
.activity-chip.poc { background: #FFF7ED; border-left-color: #F97316; color: #C2410C; }
.activity-chip.negotiation { background: #FEF2F2; border-left-color: #EF4444; color: #B91C1C; }
.activity-chip.satisfaction { background: #F0FDFA; border-left-color: #0D9488; color: #0F766E; }
.activity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.legend-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 500;
}
.legend-chip.visit { background: #EFF6FF; color: #1D4ED8; }
.legend-chip.call { background: #F5F3FF; color: #6D28D9; }
.legend-chip.demo { background: #ECFDF5; color: #047857; }
.legend-chip.poc { background: #FFF7ED; color: #C2410C; }
.legend-chip.negotiation { background: #FEF2F2; color: #B91C1C; }
.legend-chip.satisfaction { background: #F0FDFA; color: #0F766E; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition);
  padding: 24px;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-card {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  transform: translateY(12px); transition: var(--transition);
}
.modal-overlay.show .modal-card { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.modal-header h3 i { color: var(--primary); margin-right: 6px; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  padding: 6px; border-radius: var(--radius-sm); font-size: 16px;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--gray-100);
}
.detail-kv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
}
.detail-kv { display: flex; flex-direction: column; gap: 4px; }
.detail-kv.full { grid-column: span 2; }
.detail-k { font-size: 12px; color: var(--gray-500); }
.detail-v { font-size: 13px; color: var(--gray-800); line-height: 1.5; }
.risk-tag {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.risk-no { background: #ECFDF5; color: #047857; }
.risk-warn { background: #FFF7ED; color: #C2410C; }
.risk-yes { background: #FEF2F2; color: #B91C1C; }
.feedback-box {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--gray-200); background: var(--gray-50);
}
.feedback-box-title {
  font-size: 13px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.feedback-box-title i { font-size: 14px; }
.feedback-market .feedback-box-title i { color: #2563EB; }
.feedback-tech .feedback-box-title i { color: #059669; }
.feedback-box-content {
  font-size: 13px; color: var(--gray-700); line-height: 1.65;
  background: white; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
}
.activity-detail-modal { max-width: 520px; }
.activity-chip { cursor: pointer; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-md); color: white; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease; max-width: 360px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.loading-state { text-align: center; padding: 60px; color: var(--gray-400); font-size: 14px; }
.loading-state i { margin-right: 8px; }

.pain-tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; margin: 2px; }
.pain-security { background: #FEF2F2; color: #DC2626; }
.pain-efficiency { background: #EFF6FF; color: #2563EB; }
.pain-cost { background: #FFF7ED; color: #EA580C; }
.pain-compliance { background: #F5F3FF; color: #7C3AED; }
.pain-innovation { background: #ECFDF5; color: #059669; }

.outcome-positive { color: var(--success); }
.outcome-neutral { color: var(--warning); }
.outcome-negative { color: var(--danger); }

/* Mobile top bar & sidebar overlay */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 90;
}
.mobile-menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mobile-menu-btn:active { background: var(--gray-100); }
.mobile-topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row, .two-col-row, .detail-grid { grid-template-columns: 1fr; }
  .radar-card { grid-column: span 1; }
  .profile-summary { flex-direction: column; align-items: flex-start; }
  .profile-dim-pills { width: 100%; }
  .profile-dim-pill { flex: 1; min-width: 0; }
  .radar-layout-split { grid-template-columns: 1fr; }
  .industry-board { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 20px 16px; }
  .main-content.customers-wide { padding: 20px 12px; }
  .page-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .page-header-right { display: flex; flex-wrap: wrap; gap: 8px; }
  .date-display { width: 100%; text-align: center; }
  .filter-bar { gap: 10px; }
  .search-input { flex: 1; min-width: 140px; width: auto; }
  .view-toggle { margin-left: 0; }
  .activity-legend { margin-left: 0; width: 100%; }
  .funnel-label { width: 72px; font-size: 12px; }
  .detail-header { flex-direction: column; align-items: flex-start; }
  .detail-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .detail-tab { flex-shrink: 0; white-space: nowrap; }
  .match-card { flex-direction: column; align-items: flex-start; }
  .match-score { width: auto; text-align: left; }
  .modal-card { max-width: calc(100vw - 32px); }
  .detail-kv-grid { grid-template-columns: 1fr; }
  .detail-kv.full { grid-column: span 1; }
  .customer-overview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }
  .sidebar-backdrop { display: block; }
  .sidebar {
    transform: translateX(-100%);
    width: min(280px, 86vw);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.collapsed {
    width: min(280px, 86vw);
  }
  .sidebar.collapsed .sidebar-title,
  .sidebar.collapsed .nav-section-title,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .user-details,
  .sidebar.collapsed .logout-btn {
    display: block;
  }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 10px 12px; }
  .sidebar.collapsed .sidebar-header { flex-direction: row; padding: 20px 16px; }
  .sidebar.collapsed .sidebar-logo { gap: 10px; justify-content: flex-start; }
  .sidebar.collapsed .logo-icon-sm { width: 36px; height: 36px; font-size: 16px; }
  .sidebar.collapsed .sidebar-toggle { margin-left: auto; }
  .sidebar.collapsed .sidebar-footer { padding: 16px; }
  .sidebar.collapsed .user-info { justify-content: flex-start; }
  .sidebar.collapsed .user-avatar { width: 36px; height: 36px; font-size: 14px; }
  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 16px 12px 24px; }
  .main-content.customers-wide { padding: 16px 10px 24px; }
  .tab-bar-wrap { padding: 0 8px; }
  .stats-grid { grid-template-columns: 1fr; }
  .industry-board { grid-template-columns: 1fr; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 24px; }
  .page-title { font-size: 18px; }
  .page-subtitle { font-size: 12px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input,
  .mini-select { width: 100%; }
  .category-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cat-tab { flex-shrink: 0; white-space: nowrap; }
  .industry-summary { flex-direction: column; align-items: flex-start; }
  .industry-summary-stats { width: 100%; justify-content: space-between; gap: 12px; }
  .industry-list-view {
    background: transparent;
    border: none;
    overflow: visible;
    border-radius: 0;
  }
  .industry-list-view .industry-customer-table {
    display: block;
    overflow: visible;
    width: 100%;
  }
  .industry-customer-table thead { display: none; }
  .industry-customer-table tbody { display: block; }
  .industry-customer-table tr {
    display: block;
    margin-bottom: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .industry-customer-table tr:active { background: var(--gray-50); }
  .industry-customer-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 11px 14px;
    border-bottom: 1px dashed var(--gray-100);
    white-space: normal;
    max-width: none;
    min-width: 0;
  }
  .industry-customer-table td:last-child { border-bottom: none; }
  .industry-customer-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    min-width: 0;
    max-width: none;
    width: 100%;
    line-height: 1.45;
  }
  .industry-customer-table td:first-child {
    gap: 4px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 14px;
  }
  .industry-customer-table td:first-child::before { display: none; }
  .industry-customer-table td .table-cell-value {
    width: 100%;
    font-size: 13px;
    color: var(--gray-800);
    word-break: break-word;
    line-height: 1.45;
  }
  .industry-customer-table td.table-contact,
  .industry-customer-table td.table-collab,
  .industry-customer-table td.table-date { text-align: left; }
  .industry-customer-table .table-collab-item {
    width: 100%;
    text-align: left;
    word-break: break-word;
  }
  .industry-customer-table .table-collab-item + .table-collab-item {
    margin-top: 0;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
  }
  .customer-overview-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
  .customer-detail-header { padding: 16px; gap: 10px; }
  .customer-detail-head-row { flex-wrap: wrap; gap: 12px; }
  .customer-detail-title-wrap { max-width: none; flex: 1 1 100%; }
  .customer-header-brief {
    flex: 1 1 100%; order: 3;
    border-left: none; border-right: none;
    padding: 12px 0 0; border-top: 1px dashed var(--gray-200);
  }
  .header-brief-text { -webkit-line-clamp: unset; }
  .customer-detail-header .detail-score-ring { order: 2; margin-left: auto; }
  .customer-detail-title-wrap h2 { font-size: 18px; gap: 6px 8px; }
  .customer-detail-header .detail-score-ring { padding: 8px 12px; min-width: 64px; }
  .customer-detail-header .score-ring-value { font-size: 26px; }
  .customer-detail-header .score-ring-label { font-size: 10px; }
  .customer-detail-header .detail-full-name { font-size: 13px; }
  .customer-detail-header .detail-header-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .customer-detail-header .detail-header-meta span { font-size: 12px; }
  .customer-tag-row { gap: 5px; }
  .customer-tag { font-size: 10px; padding: 2px 8px; }
  .overview-card-bar { padding: 10px 12px 8px; }
  .overview-highlight { padding: 7px 12px; font-size: 11px; }
  .overview-card-body { padding: 8px 12px 12px; gap: 6px; }
  .overview-score-pill { font-size: 14px; padding: 2px 8px; }
  .overview-mini-stat .oms-val { font-size: 13px; }
  .customer-goals-section { padding: 16px 14px; margin-bottom: 16px; }
  .goals-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .goals-section-head h3 { font-size: 16px; }
  .overall-goal-card { padding: 14px; margin-bottom: 16px; }
  .overall-goal-title { font-size: 16px; }
  .overall-goal-desc { font-size: 12px; }
  .sub-goal-head h4 { font-size: 14px; }
  .goal-task-card { padding: 12px 14px; }
  .goal-task-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .goal-task-title { font-size: 13px; }
  .goal-task-actions { width: 100%; }
  .goal-task-actions .btn-outline { flex: 1; justify-content: center; min-height: 38px; }
  .goal-metric-name { flex-basis: 72px; }
  .goal-task-meta-grid { grid-template-columns: 1fr; gap: 10px; }
  .goal-collab-wrap { flex-direction: column; align-items: stretch; }
  .goal-collab-chip { display: block; width: 100%; box-sizing: border-box; }
  .goal-task-modal { max-width: none; width: 100%; }
  .goal-milestone-modal { max-width: none; width: 100%; }
  .metric-editor-head { display: none; }
  .metric-editor-row { grid-template-columns: 1fr 1fr; }
  .metric-editor-row .mt-name { grid-column: 1 / -1; }
  .metric-editor-row .btn-icon-sm { grid-column: 2; justify-self: end; }
  .goal-progress-form { padding: 12px; }
  .goal-textarea { font-size: 16px; }
  .goal-log-meta-grid { gap: 6px; }
  .goal-log-meta-grid span { word-break: break-word; line-height: 1.45; }
  .detail-back { min-height: 44px; padding: 6px 0; margin-bottom: 12px; }
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .customer-card-grid,
  .solution-grid { grid-template-columns: 1fr; }
  .customer-quick-grid { grid-template-columns: 1fr; padding: 12px 14px 16px; }
  .role-cards { flex-direction: column; }
  .btn-primary,
  .btn-outline { width: 100%; justify-content: center; }
  .page-header-right .btn-primary { width: auto; flex: 1; }
  .pipeline-stepper { padding: 16px; gap: 4px; }
  .step-item { min-width: 120px; }
  .step-label { font-size: 12px; }
  .dim-field { flex-direction: column; gap: 4px; }
  .dim-field-value { text-align: left; max-width: 100%; }
  .radar-wrap { width: min(260px, 100%); height: auto; aspect-ratio: 1; }
  .timeline-node { gap: 12px; }
  .timeline-card-head { gap: 6px; }
  .timeline-key-badge { margin-left: 0; }
  .activity-matrix-wrap {
    margin: 0 -10px;
    padding: 0 10px 8px;
    -webkit-overflow-scrolling: touch;
  }
  .activity-matrix { min-width: 640px; }
  .activity-industry-header { flex-wrap: wrap; gap: 6px; }
  .activity-industry-count { margin-left: 0; width: 100%; }
  .toast-container { left: 12px; right: 12px; top: auto; bottom: 16px; }
  .toast { max-width: none; animation: toastInMobile 0.3s ease; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-card { max-height: 85vh; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn-primary,
  .modal-footer .btn-ghost { flex: 1; min-width: 120px; justify-content: center; }
  .chart-body { height: 200px; }
  .funnel-step { flex-wrap: wrap; gap: 8px; }
  .funnel-label { width: 100%; text-align: left; }
  .funnel-rate { width: auto; margin-left: auto; }
}

@media (max-width: 480px) {
  .stat-icon { width: 44px; height: 44px; font-size: 18px; }
  .detail-tab { padding: 8px 14px; font-size: 12px; }
  .profile-dim-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .profile-dim-pill { min-width: 0; }
  .chain-card { max-width: none; }
  .industry-summary { padding: 14px 16px; }
  .industry-summary-icon { width: 40px; height: 40px; font-size: 18px; }
  .industry-summary-title { font-size: 15px; }
  .industry-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
  }
  .industry-summary-stat { min-width: 0; text-align: left; }
  .industry-summary-stat .val { font-size: 18px; }
  .industry-customer-table td::before { font-size: 10px; }
  .industry-customer-table td { padding: 10px 12px; }
  .industry-tabs-bar .cat-tab { padding: 6px 12px; font-size: 12px; }
  .customer-overview-grid { grid-template-columns: 1fr; }
  .customer-goals-section { padding: 14px 12px; }
  .overall-goal-title { font-size: 15px; }
  .customer-detail-header { padding: 14px 12px; }
  .customer-detail-title-wrap h2 { font-size: 17px; }
  .customer-detail-header .score-ring-value { font-size: 22px; }
  .customer-detail-header .detail-score-ring { padding: 7px 10px; min-width: 58px; }
  .overview-score-pill { font-size: 13px; }
  .goal-task-card { padding: 11px 12px; }
  .goal-progress-pct { font-size: 12px; min-width: 32px; }
  .modal-footer .btn-primary#goalTaskSubmitBtn { width: 100%; flex: none; }
}

@keyframes toastInMobile {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Prevent body scroll when mobile sidebar open */
body.sidebar-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .ict-bg-mesh,
  .ict-grid-layer,
  .ict-hex-layer,
  .ict-data-streams span,
  .ict-glow-orbs span,
  .ict-particles span,
  .ict-scan-sweep,
  .ict-scan-line { animation: none; }
  .ict-particle-canvas { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  .nav-item,
  .customer-card,
  .stat-card,
  .quick-card,
  .btn-primary,
  .btn-outline,
  .mobile-menu-btn,
  .industry-customer-table tr,
  .detail-back,
  .goal-task-update-btn {
    min-height: 44px;
  }
  .goal-task-card:hover { box-shadow: none; border-color: var(--gray-200); }
}
