/* AEOS Dashboard V2 — Design system */
:root {
  --bg: #06060a;
  --card-from: #111118;
  --card-to: #0d0d14;
  --border: rgba(59, 130, 246, 0.08);
  --border-hover: rgba(59, 130, 246, 0.25);
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --yellow: #eab308;
  --radius: 16px;
  --padding: 24px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --text: #e2e8f0;
  --text-secondary: #64748b;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --body-size: 13px;
  --label-size: 11px;
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.06), transparent);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body-size);
  line-height: 1.5;
  transition: var(--transition);
}

body.fade-in main { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-top: 5.5rem;
}

/* Navbar — glassmorphism */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(6, 6, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: var(--transition);
}

.nav-logo {
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav-logo::after { content: "•"; color: var(--accent); margin-left: 1px; }

.nav-logo:hover { color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  font-size: var(--body-size);
  font-weight: 500;
  border-radius: 8px;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.nav-logout { margin-left: 0.5rem; color: var(--text-secondary) !important; }

.nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E") center/contain no-repeat;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 52px;
    right: 0;
    flex-direction: column;
    background: rgba(6, 6, 10, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    padding: 1rem;
    min-width: 200px;
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  body.nav-open .nav-links { transform: translateX(0); }
}

/* Cards */
.card {
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--padding);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

/* Stat cards — left border accent */
.stat-card {
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--padding);
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }

.stat-card.border-blue { border-left-color: var(--accent); }
.stat-card.border-green { border-left-color: var(--green); }
.stat-card.border-orange { border-left-color: var(--orange); }

.stat-card .value { font-size: 36px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .label { font-size: var(--label-size); color: var(--text-secondary); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  font-family: var(--font);
  font-size: var(--body-size);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(59, 130, 246, 0.15); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* Score badges — pill with glow */
.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-urgent { background: rgba(239, 68, 68, 0.25); color: #fca5a5; box-shadow: 0 0 12px rgba(239, 68, 68, 0.2); }
.badge-high { background: rgba(245, 158, 11, 0.25); color: #fcd34d; box-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
.badge-mid { background: rgba(234, 179, 8, 0.25); color: #fde047; }
.badge-low { background: rgba(100, 116, 139, 0.3); color: var(--text-secondary); }

/* Status dots */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.today { background: var(--red); animation: pulse 1.5s ease-in-out infinite; }
.status-dot.week { background: var(--orange); }
.status-dot.quiet { background: var(--text-secondary); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Avatar initials */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.avatar-lane-1 { background: var(--accent); }
.avatar-lane-2 { background: var(--green); }
.avatar-lane-3 { background: var(--purple); }
.avatar-lane-4 { background: var(--text-secondary); }

/* Velocity badges */
.velocity-serial { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.velocity-active { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.velocity-standard { background: rgba(234, 179, 8, 0.25); color: #fde047; }
.velocity-quiet { background: rgba(100, 116, 139, 0.3); color: var(--text-secondary); }

.velocity-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: var(--label-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Page headers */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; margin: 0 0 0.25rem 0; }
.page-header .subtitle { color: var(--text-secondary); font-size: var(--body-size); }

/* Dashboard home */
.dash-banner { text-align: center; margin-bottom: 1.5rem; }
.dash-banner .logo { font-size: clamp(24px, 4vw, 32px); font-weight: 700; color: #fff; }
.dash-banner .logo::after { content: "•"; color: var(--accent); }
.dash-banner .tagline { color: var(--text-secondary); font-size: var(--body-size); margin-top: 0.25rem; }
.last-refresh { color: var(--text-secondary); font-size: var(--label-size); margin-top: 0.5rem; }

/* Signal cards */
.top3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.signal-card {
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--padding);
  transition: var(--transition);
}
.signal-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }

.signal-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.signal-card .company { font-size: 1.1rem; font-weight: 700; color: #fff; }
.signal-card .headline { margin: 0.5rem 0; }
.signal-card .headline a { color: var(--text); text-decoration: none; }
.signal-card .headline a:hover { color: var(--accent); text-decoration: underline; }
.signal-card .insight { font-size: var(--body-size); color: var(--text-secondary); margin: 0.5rem 0; line-height: 1.4; }
.signal-card-contacts { display: flex; flex-direction: column; gap: 8px; margin: 1rem 0; }
.signal-contact-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.avatar-signal { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.signal-contact-name { font-size: 12px; font-weight: 700; color: var(--text); }
.signal-contact-title { font-size: 11px; color: var(--text-secondary); }
.signal-contact-icon { font-size: 11px; color: var(--accent); text-decoration: none; margin-left: 4px; }
.signal-contact-icon:hover { text-decoration: underline; }
.signal-card .actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Weekly preview */
.weekly-preview {
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--padding);
  margin-bottom: 1.5rem;
  max-height: 180px;
  overflow: hidden;
}
.weekly-preview-body { font-size: var(--body-size); color: var(--text-secondary); line-height: 1.5; }
.weekly-preview-body h1, .weekly-preview-body h2 { font-size: 1rem; color: var(--text); }
.weekly-preview .read-more { display: inline-block; margin-top: 0.75rem; color: var(--accent); font-weight: 500; text-decoration: none; }
.weekly-preview .read-more:hover { text-decoration: underline; }

/* SEC list */
.sec-list { list-style: none; padding: 0; margin: 0; }
.sec-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.sec-list li:last-child { border-bottom: none; }
.sec-list a { color: var(--accent); text-decoration: none; }
.sec-list a:hover { text-decoration: underline; }
.sec-badge { font-size: var(--label-size); padding: 0.2rem 0.5rem; border-radius: 6px; background: rgba(59, 130, 246, 0.2); color: var(--accent); }

/* Accounts — consolidated parent cards */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar input[type="search"] {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-from);
  color: var(--text);
  font-family: var(--font);
  min-width: 220px;
  font-size: var(--body-size);
}
.toolbar select {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-from);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body-size);
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) { .accounts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .accounts-grid { grid-template-columns: 1fr; } }

.account-card {
  display: block;
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--padding);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  min-height: 200px;
}
.account-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.account-card .row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.account-card .name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.account-card .subs { font-size: var(--label-size); color: var(--text-secondary); margin-top: 0.25rem; }
.account-card .meta { font-size: var(--label-size); color: var(--text-secondary); margin-top: 0.75rem; }
.account-card .card-contacts { font-size: var(--label-size); color: var(--text-secondary); margin-top: 0.5rem; }

/* Account detail — hero */
.hero { margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(24px, 4vw, 32px); margin: 0 0 0.25rem 0; color: #fff; }
.hero .parent-badge { font-size: var(--body-size); color: var(--text-secondary); }
.hero-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.hero-stats .mini {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: var(--label-size);
  color: var(--text-secondary);
}
.hero-stats .mini strong { color: var(--text); }
.hero-nav { display: flex; gap: 0.5rem; margin-top: 1rem; }
.hero-nav .btn { padding: 0.5rem 0.75rem; }

/* Back link */
.back-link { margin-bottom: 0.75rem; }
.back-link a { color: var(--text-secondary); text-decoration: none; font-size: var(--body-size); }
.back-link a:hover { color: var(--accent); }

/* Deal Map — visual lanes */
.deal-map-wrap { margin-bottom: 1rem; }
.deal-map { display: flex; flex-direction: column; gap: 20px; }
.deal-lane {
  background: linear-gradient(135deg, #111118, #0d0d14);
  border-radius: 16px;
  padding: 20px;
  border-left: 3px solid;
  transition: var(--transition);
}
.deal-lane.lane-1 { border-left-color: #3b82f6; border-left-width: 4px; background: linear-gradient(135deg, #13151e, #0e0f18); }
.deal-lane.lane-2 { border-left-color: #10b981; }
.deal-lane.lane-3 { border-left-color: #8b5cf6; }
.deal-lane.lane-4 { border-left-color: #475569; }
.deal-lane.lane-empty { opacity: 0.5; }
.lane-header { margin-bottom: 0.5rem; }
.lane-title { font-weight: 700; font-size: 1rem; color: var(--text); display: block; }
.lane-hint { font-size: 12px; color: var(--text-secondary); display: block; margin-top: 0.25rem; }
.lane-contacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.lane-contact-card {
  min-width: 220px;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 12px;
  transition: all 0.2s ease;
}
.lane-contact-card:hover { border-color: rgba(59, 130, 246, 0.2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
.lane-contact-card .avatar { flex-shrink: 0; }
.lane-card-body { flex: 1; min-width: 0; }
.lane-card-name { font-weight: 700; font-size: 14px; color: var(--text); }
.lane-card-title { font-size: 12px; color: var(--text-secondary); margin-top: 0.15rem; }
.lane-card-links { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.lane-card-links a { color: var(--accent); text-decoration: none; font-size: 12px; }
.lane-card-links a:hover { text-decoration: underline; }
.priority-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-top: 0.35rem; }
.priority-pill.priority-1 { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.priority-pill.priority-2 { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.priority-pill.priority-3 { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
.lane-card-enriched { font-size: 11px; color: var(--text-secondary); margin-top: 0.25rem; }
.lane-empty-msg { margin: 0; color: var(--text-secondary); font-size: 12px; }
.no-linkedin { font-size: 11px; color: var(--orange); }
.gap-analysis {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(245, 158, 11, 0.05);
  border-left: 3px solid var(--orange);
  border-radius: 0 12px 12px 0;
}
.gap-analysis strong { display: block; margin-bottom: 0.5rem; }
.gap-analysis ul { margin: 0.5rem 0 0 1rem; padding: 0; }
.view-toggle { margin-bottom: 1rem; }
.view-toggle .btn { margin-right: 0.5rem; }
.view-tab-active { border-bottom-color: var(--accent); }

/* Account Intelligence */
.account-intel-card { background: rgba(59, 130, 246, 0.03); border-radius: 16px; }
.account-intel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem; }
.account-intel-title { font-weight: 700; font-size: 20px; margin: 0; }
.account-intel-title .icon { font-size: 16px; opacity: 0.8; }
.btn-pill { border-radius: 999px; }
.notes-saved-toast { color: var(--green); font-size: 13px; animation: fadeOut 2s ease 2s forwards; }
@keyframes fadeOut { to { opacity: 0; } }
.account-intel-hint { font-size: 11px; color: var(--text-secondary); margin: 0 0 1rem 0; }
.intel-sections { display: flex; flex-direction: column; gap: 0.5rem; }
.intel-section-header {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}
.intel-section-header:hover { background: rgba(255,255,255,0.06); }
.intel-section-header .icon { font-size: 1rem; }
.intel-section-header::after { content: "▼"; font-size: 10px; margin-left: auto; transition: transform 0.2s; }
.intel-section-header[aria-expanded="false"]::after { transform: rotate(-90deg); }
.intel-section-body { padding: 0.5rem 0 0.5rem 0; }
.intel-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0d0d14;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  resize: vertical;
  overflow-y: auto;
}
.notes-last-updated { font-size: 12px; color: var(--text-secondary); margin: 1rem 0 0 0; }
/* Knowledge Base */
.knowledge-title { font-weight: 700; font-size: 18px; margin: 0 0 0.25rem 0; }
.knowledge-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0 0 1rem 0; }
.knowledge-add { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.knowledge-input { flex: 1; padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: #0d0d14; color: var(--text); font-family: var(--font); font-size: 13px; }
.knowledge-list { display: flex; flex-direction: column; gap: 0.5rem; }
.knowledge-entry {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 13px;
}
.knowledge-entry-text { flex: 1; color: var(--text); }
.knowledge-entry-date { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.knowledge-delete { width: 24px; height: 24px; padding: 0; border: none; background: rgba(239,68,68,0.2); color: #fca5a5; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; }
.knowledge-delete:hover { background: rgba(239,68,68,0.35); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); margin-left: 0.5rem; padding-left: 1.25rem; }
.timeline li { position: relative; padding-bottom: 1rem; transition: var(--transition); }
.timeline li:hover { padding-left: 4px; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lane-color, var(--accent));
}
.timeline .date { font-size: var(--label-size); color: var(--text-secondary); }
.timeline .headline { font-size: var(--body-size); margin: 0.25rem 0; }
.timeline .cat { display: inline-block; font-size: 10px; padding: 0.2rem 0.5rem; border-radius: 6px; margin-top: 0.25rem; }
.timeline .year-divider { list-style: none; border: none; padding: 0.5rem 0; margin-left: -1.25rem; }
.timeline .year-divider::before { display: none; }
.timeline .year-divider .date { font-weight: 600; color: var(--text); }
.cat-ma { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.cat-leadership { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.cat-tech, .cat-tech-digital { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.cat-financial { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
.cat-expansion { background: rgba(20, 184, 166, 0.25); color: #5eead4; }
.cat-layoffs, .cat-layoffs-restructure { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.cat-regulatory { background: rgba(234, 179, 8, 0.25); color: #fde047; }
.cat-other { background: rgba(100, 116, 139, 0.3); color: var(--text-secondary); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: var(--body-size); }
table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
table tr:hover { background: rgba(255, 255, 255, 0.04); }
table th { color: var(--text-secondary); font-weight: 500; font-size: var(--label-size); text-transform: uppercase; letter-spacing: 0.04em; }
table a { color: var(--accent); text-decoration: none; }
table a:hover { text-decoration: underline; }

/* Contacts directory */
.contacts-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; font-size: var(--body-size); color: var(--text-secondary); }
.contacts-stats strong { color: var(--text); }
.contacts-table .avatar-cell { width: 40px; }

/* Weekly strategy page */
.weekly-wrap { display: flex; gap: 1.5rem; align-items: flex-start; }
.weekly-toc {
  position: sticky;
  top: 80px;
  flex: 0 0 220px;
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.weekly-toc ul { list-style: none; padding: 0; margin: 0; font-size: var(--body-size); }
.weekly-toc a { color: var(--text-secondary); text-decoration: none; display: block; padding: 0.35rem 0; }
.weekly-toc a:hover { color: var(--accent); }
.weekly-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  background: linear-gradient(180deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--padding);
}
.weekly-content h1 { font-size: 1.5rem; margin-top: 1rem; }
.weekly-content h2 { font-size: 1.25rem; margin-top: 1.25rem; }
.weekly-content h3 { font-size: 1.1rem; margin-top: 1rem; }
.weekly-content p { margin: 0.5rem 0; }
.weekly-content ul, .weekly-content ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.weekly-content table { margin: 1rem 0; width: 100%; }
.weekly-content table tr:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
.weekly-content pre, .weekly-content code { background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 0.2rem 0.5rem; font-size: 0.9em; }
.weekly-content pre { padding: 1rem; overflow-x: auto; }
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--border); z-index: 99; }
.reading-progress .fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.1s; }
.gen-ts { color: var(--text-secondary); font-size: var(--label-size); margin-bottom: 1rem; }

/* Meeting prep */
.prep-form .form-group { margin-bottom: 1rem; }
.prep-form label { display: block; margin-bottom: 0.35rem; font-weight: 500; font-size: var(--body-size); }
.prep-form input, .prep-form select, .prep-form textarea {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-from);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body-size);
}
.prep-form input:focus, .prep-form select:focus, .prep-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.prep-form textarea { min-height: 80px; resize: vertical; }
.prep-brief h2 { font-size: 1.1rem; margin: 1rem 0 0.5rem 0; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.prep-brief .copy-print { margin-bottom: 1rem; display: flex; gap: 0.5rem; }
.key-questions ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.key-questions li { margin: 0.35rem 0; }

/* Login — animated gradient and glow only on login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: linear-gradient(135deg, #06060a 0%, #0a0015 25%, #120025 50%, #0a0015 75%, #06060a 100%);
  background-size: 200% 200%;
  animation: loginGradient 15s ease infinite;
  position: relative;
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(124, 58, 237, 0.15), transparent 60%);
  z-index: 0;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.08);
}
.login-logo {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-logo .dot { color: #3b82f6; }
.login-subtitle { text-align: center; color: var(--text-secondary); font-size: var(--body-size); margin: 0 0 1.5rem 0; }
.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  margin-bottom: 1rem;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.login-form .btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
}
.login-form .btn:hover {
  filter: brightness(1.1);
}
@keyframes loginGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Flash */
.flash-wrap { margin-bottom: 1rem; }
.flash { padding: 0.75rem 1rem; border-radius: 10px; font-size: var(--body-size); }
.flash-error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.flash-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* AI Chat — floating button and panel */
/* Hide floating chat on account detail page (inline chat used instead) */
.page-account-detail .aeos-chat-fab,
.page-account-detail .aeos-chat-panel { display: none !important; }

.aeos-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.aeos-chat-fab:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4); }
.aeos-chat-fab.pulse { animation: aeosChatPulse 1.5s ease-in-out 3; }
@keyframes aeosChatPulse { 0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3); } 50% { box-shadow: 0 4px 28px rgba(59, 130, 246, 0.5); } }

.aeos-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 100px);
  background: #0d0d14;
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.aeos-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.aeos-chat-panel.minimized { height: 0; min-height: 0; overflow: hidden; }

.aeos-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  flex-shrink: 0;
}
.aeos-chat-title-wrap { display: flex; flex-direction: column; gap: 0; }
.aeos-chat-title { font-weight: 700; font-size: 1.1rem; color: #fff; }
.aeos-chat-title .aeos-dot { color: #3b82f6; }
.aeos-chat-subtitle { font-size: 11px; color: var(--text-secondary); margin-top: 0; }
.aeos-chat-actions { display: flex; gap: 4px; }
.aeos-chat-btn-icon {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.aeos-chat-btn-icon:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.aeos-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aeos-chat-msg { max-width: 85%; align-self: flex-start; }
.aeos-chat-msg.user { max-width: 80%; align-self: flex-end; }
.aeos-chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}
.aeos-chat-msg.user .aeos-chat-msg-bubble {
  background: #3b82f6;
  color: #fff;
}
.aeos-chat-msg:not(.user) .aeos-chat-msg-bubble {
  background: #1a1a2e;
  color: #e2e8f0;
}
.aeos-chat-bubble-inner { position: relative; padding-right: 28px; }
.aeos-chat-save-knowledge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.aeos-chat-save-knowledge:hover { background: rgba(59,130,246,0.35); }
.aeos-chat-toast {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  padding: 8px 12px;
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.aeos-chat-toast.aeos-chat-toast-show { opacity: 1; }
.aeos-chat-msg-time { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.aeos-chat-msg.user .aeos-chat-msg-time { text-align: right; }
.aeos-chat-assistant-content p { margin: 0.5rem 0; }
.aeos-chat-assistant-content p:first-child { margin-top: 0; }
.aeos-chat-assistant-content ul, .aeos-chat-assistant-content ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.aeos-chat-assistant-content code { background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.aeos-chat-code-block { position: relative; margin: 8px 0; border-radius: 8px; overflow: hidden; }
.aeos-chat-code-block pre { margin: 0; padding: 12px; background: #111118; font-size: 12px; overflow-x: auto; }
.aeos-chat-code-block .aeos-chat-copy-btn { position: absolute; top: 8px; right: 8px; padding: 4px 8px; font-size: 11px; border-radius: 6px; border: 1px solid rgba(59,130,246,0.3); background: rgba(59,130,246,0.15); color: #93c5fd; cursor: pointer; }
.aeos-chat-code-block .aeos-chat-copy-btn:hover { background: rgba(59,130,246,0.25); }
.aeos-chat-email-card { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); border-radius: 10px; padding: 12px; margin: 8px 0; }
.aeos-chat-email-card .aeos-chat-copy-btn { margin-top: 8px; padding: 6px 12px; font-size: 12px; border-radius: 8px; background: #3b82f6; color: #fff; border: none; cursor: pointer; }
.aeos-chat-thinking { padding: 10px 14px; }
.aeos-chat-thinking-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #64748b; margin: 0 2px; animation: aeosChatBounce 1.4s ease-in-out infinite both; }
.aeos-chat-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.aeos-chat-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aeosChatBounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

.aeos-chat-quick-actions {
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  border-top: 1px solid rgba(59,130,246,0.06);
}
.aeos-chat-quick-pill {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,0.25);
  background: rgba(59,130,246,0.08);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.aeos-chat-quick-pill:hover { background: rgba(59,130,246,0.18); border-color: rgba(59,130,246,0.4); }

.aeos-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #111118;
  border-top: 1px solid rgba(59,130,246,0.1);
  flex-shrink: 0;
  align-items: flex-end;
}
.aeos-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 80px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0d0d14;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.aeos-chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.aeos-chat-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.2s;
}
.aeos-chat-send:hover { filter: brightness(1.1); }
.aeos-chat-send:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 768px) {
  .aeos-chat-panel { width: 100%; max-width: none; right: 0; bottom: 0; height: 100vh; max-height: none; border-radius: 16px 16px 0 0; }
  .aeos-chat-fab { bottom: 24px; right: 24px; }
  .deal-map { flex-direction: column; }
  .lane-contact-card { min-width: 100%; max-width: 100%; }
  .account-intel-card .intel-textarea,
  .knowledge-input { width: 100%; box-sizing: border-box; }
  .detail-grid { grid-template-columns: 1fr !important; }
}

/* 404 */
.not-found-wrap { text-align: center; padding: 4rem 2rem; }
.not-found-wrap h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.not-found-wrap p { color: var(--text-secondary); margin-bottom: 1.5rem; }

/* --- V4 Account page: zones, brief card, inline chat, collapsibles --- */
.account-page-v4 { max-width: 900px; margin: 0 auto; padding: 40px 0; }
.account-page-v4 .zone { margin-bottom: 32px; }
.account-page-v4 .supporting-data { margin-top: 48px; }

.account-header-v4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 20px; margin-bottom: 32px; }
.account-header-v4 .back-link { width: 100%; margin: 0 0 4px 0; }
.account-header-v4 .back-link a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.account-header-v4 .back-link a:hover { color: var(--accent); }
.account-header-v4 h1 { font-size: 28px; font-weight: 700; margin: 0; color: #fff; flex: 1 1 auto; }
.account-header-v4 .velocity-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-left: 8px; }
.account-header-v4 .velocity-pill.serial { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.account-header-v4 .velocity-pill.active { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.account-header-v4 .velocity-pill.standard { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.account-header-v4 .velocity-pill.quiet { background: rgba(71, 85, 105, 0.3); color: #94a3b8; }
.account-header-v4 .header-stats { font-size: 13px; color: var(--text-secondary); width: 100%; margin-top: 4px; }
.account-header-v4 .header-nav { display: flex; gap: 12px; margin-left: auto; }
.account-header-v4 .header-nav a { color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.account-header-v4 .header-nav a:hover { color: var(--accent); }

.brief-card { max-width: 900px; margin: 0 auto 32px; background: rgba(59, 130, 246, 0.03); border-left: 4px solid #3b82f6; border-radius: 16px; padding: 28px 32px; }
.brief-card .brief-text { font-size: 15px; line-height: 1.75; color: #e8edf4; margin: 0 0 1rem 0; white-space: pre-wrap; }
.brief-card .brief-meta { font-size: 12px; color: var(--text-secondary); }
.brief-card .brief-meta .refresh-link { color: var(--accent); cursor: pointer; text-decoration: none; margin-left: 8px; }
.brief-card .brief-meta .refresh-link:hover { text-decoration: underline; }
.brief-card .brief-stale { display: inline-block; margin-left: 8px; padding: 2px 8px; background: rgba(245, 158, 11, 0.15); border-radius: 6px; font-size: 11px; color: #fcd34d; }
.brief-card .brief-empty-state { color: var(--text-secondary); font-size: 14px; margin: 0; }
.brief-card .btn-generate-brief { margin-top: 12px; }

.brief-shimmer { display: flex; flex-direction: column; gap: 10px; }
.brief-shimmer .shimmer-line { height: 14px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.brief-shimmer .shimmer-line:nth-child(1) { width: 95%; }
.brief-shimmer .shimmer-line:nth-child(2) { width: 88%; }
.brief-shimmer .shimmer-line:nth-child(3) { width: 70%; }
.brief-shimmer .shimmer-line:nth-child(4) { width: 82%; }
.brief-shimmer .shimmer-line:nth-child(5) { width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.chat-card { max-width: 900px; margin: 0 auto; background: linear-gradient(135deg, #111118, #0d0d14); border: 1px solid rgba(59, 130, 246, 0.08); border-radius: 16px; padding: 24px 28px; }
.chat-card .chat-card-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 16px 0; }
.chat-card .aeos-inline-messages { min-height: 250px; max-height: 500px; overflow-y: auto; margin-bottom: 16px; }
.chat-card .aeos-inline-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chat-card .aeos-inline-quick-pill { padding: 6px 14px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: var(--text); cursor: pointer; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-card .aeos-inline-quick-pill:hover { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); }
.chat-card .aeos-inline-input-wrap { display: flex; gap: 10px; align-items: flex-end; }
.chat-card .aeos-inline-input { flex: 1; min-height: 44px; max-height: 80px; padding: 12px 16px; border-radius: 12px; background: #0d0d14; border: 1px solid rgba(255,255,255,0.08); color: var(--text); font-size: 14px; line-height: 1.5; resize: none; font-family: inherit; }
.chat-card .aeos-inline-input:focus { outline: none; border-color: var(--accent); }
.chat-card .aeos-inline-send { width: 44px; height: 44px; flex-shrink: 0; border: none; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-card .aeos-inline-send:hover { filter: brightness(1.1); }
.chat-card .aeos-inline-send:disabled { opacity: 0.6; cursor: not-allowed; }
.chat-card .aeos-chat-msg { margin-bottom: 12px; }
.chat-card .aeos-chat-msg-bubble { max-width: 85%; }
.chat-card .aeos-chat-save-knowledge { margin-left: 8px; opacity: 0.8; cursor: pointer; background: none; border: none; color: var(--text-secondary); font-size: 14px; }
.chat-card .aeos-chat-save-knowledge:hover { color: var(--accent); }

.collapsible-section { margin-bottom: 8px; }
.collapsible-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; background: linear-gradient(135deg, #111118, #0d0d14); border: 1px solid rgba(59, 130, 246, 0.06); border-radius: 12px; transition: all 0.2s ease; user-select: none; }
.collapsible-header:hover { background: rgba(255,255,255,0.03); border-color: rgba(59, 130, 246, 0.15); }
.collapsible-header .section-title { font-size: 14px; font-weight: 500; color: #94a3b8; }
.collapsible-header .section-count { font-size: 12px; color: #475569; }
.collapsible-header .chevron { color: #475569; font-size: 12px; transition: transform 0.2s ease; }
.collapsible-header .chevron.open { transform: rotate(90deg); }
.collapsible-body { overflow: hidden; max-height: 0; transition: max-height 0.4s ease; }
.collapsible-body.open { max-height: 5000px; }
.collapsible-body-inner { padding: 20px; }

.notes-textarea-v4 { width: 100%; min-height: 120px; max-height: 400px; padding: 14px; background: #0d0d14; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; color: var(--text); font-size: 13px; line-height: 1.5; resize: vertical; font-family: inherit; box-sizing: border-box; }
.notes-textarea-v4:focus { outline: none; border-color: var(--accent); }
.notes-saved-hint { font-size: 12px; color: var(--green); margin-top: 8px; }
.notes-refresh-brief-link { color: var(--accent); cursor: pointer; text-decoration: none; margin-left: 4px; }
.notes-refresh-brief-link:hover { text-decoration: underline; }

/* Print */
@media print {
  body { background: #fff; color: #000; }
  .navbar, .nav-toggle, .btn, .flash-wrap, .no-print, #aeos-chat-root, .aeos-chat-fab, .aeos-chat-panel { display: none !important; }
  .main { padding-top: 0; }
  .card { border: 1px solid #ddd; background: #fff; box-shadow: none; }
  a { color: #000; }
}
