/* ============================================================
   AeroIQ v2 — Aviation Intelligence Platform
   Theme: EFIS Glass — Deep Navy · Instrument Precision
   ============================================================ */

/* --- Custom Properties --- */
:root {
  /* Background layers — deep navy-black, like a lit cockpit at night */
  --bg-base:     #03090f;
  --bg-surface:  #060f1c;
  --bg-panel:    #091626;
  --bg-card:     #0b1a2e;
  --bg-hover:    #0f2240;
  --bg-input:    #071424;

  /* Borders — blue-tinted, instrument bezel feel */
  --border-dim:  #142238;
  --border-mid:  #1e3554;
  --border-glow: rgba(0,207,255,0.30);

  /* Accent palette — EFIS precision */
  --cyan:         #00cfff;
  --cyan-soft:    #33daff;
  --cyan-dim:     rgba(0,207,255,0.09);
  --cyan-glow:    rgba(0,207,255,0.05);
  --amber:        #ffb300;
  --amber-dim:    rgba(255,179,0,0.12);
  --green:        #00e87a;
  --green-dim:    rgba(0,232,122,0.12);
  --red:          #ff3344;
  --red-dim:      rgba(255,51,68,0.12);
  --violet:       #7c6aff;
  --violet-dim:   rgba(124,106,255,0.12);

  /* Text — blue-white tones, like LCD instrument displays */
  --text-primary:   #e8f4ff;
  --text-secondary: #5a8ab0;
  --text-dim:       #2e4a68;

  /* Typography */
  --font-display: 'Orbitron', monospace;
  --font-body:    'Exo 2', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;

  /* Layout */
  --sidebar-w:  244px;
  --header-h:   56px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadows — blue-depth */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.03) inset;
  --shadow-glow: 0 0 32px rgba(0,207,255,0.09);

  /* Transitions */
  --t: 180ms cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle avionics grid */
  background-image:
    linear-gradient(rgba(0,207,255,0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,207,255,0.014) 1px, transparent 1px);
  background-size: 48px 48px;
}

a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--t);
}

/* Instrument panel texture — subtle horizontal lines */
.sidebar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0,207,255,0.006) 2px,
    rgba(0,207,255,0.006) 3px
  );
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border-dim);
}

.logo-mark {
  flex-shrink: 0;
  animation: logo-pulse 4s ease-in-out infinite;
}
@keyframes logo-pulse {
  0%,100% { filter: drop-shadow(0 0 4px rgba(0,207,255,0.5)); }
  50%      { filter: drop-shadow(0 0 10px rgba(0,207,255,0.9)); }
}

.logo-text-wrap { display: flex; flex-direction: column; }

.logo-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-primary);
  line-height: 1;
}
.logo-iq { color: var(--cyan); }

.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Nav section labels */
.nav-section-label {
  padding: 14px 16px 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Nav list */
.nav-list { padding: 0 8px 4px; }

/* Nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t);
  position: relative;
  margin-bottom: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(0,207,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-dim);
}
.nav-item.active {
  background: rgba(0,207,255,0.08);
  color: var(--cyan);
  border-color: rgba(0,207,255,0.15);
}
/* Active indicator — left edge glow bar */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: var(--cyan);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px var(--cyan), 0 0 4px var(--cyan);
}

.nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
}

.nav-badge {
  margin-left: auto;
  background: var(--cyan);
  color: var(--bg-base);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-badge.show { display: flex; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border-dim);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}

.user-details { overflow: hidden; }
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
  flex-shrink: 0;
  animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-dim);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}

.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--t);
}
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 3px;
}

.mobile-status-dot .status-dot { width: 8px; height: 8px; }

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(3px);
  z-index: 98;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(11,18,32,0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.breadcrumb-app  { color: var(--text-dim); }
.breadcrumb-sep  { color: var(--text-dim); }
.breadcrumb-page {
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.module-viewport {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  transition: border-color var(--t), box-shadow var(--t);
  /* Top-edge instrument panel highlight */
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.015) inset;
}
.card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(0,207,255,0.05) inset;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-dim);
}

.card-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--t);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--cyan);
  color: #03090f;
  border-color: var(--cyan);
  letter-spacing: 0.3px;
}
.btn-primary:hover {
  background: var(--cyan-soft);
  box-shadow: 0 0 18px rgba(0,207,255,0.35), 0 2px 8px rgba(0,0,0,0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  border-color: var(--border-mid);
}
.btn-secondary:hover {
  background: rgba(0,207,255,0.05);
  color: var(--text-primary);
  border-color: rgba(0,207,255,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border-color: rgba(0,207,255,0.2);
}
.btn-ghost:hover {
  background: var(--cyan-dim);
  border-color: rgba(0,207,255,0.35);
}

.btn-amber {
  background: var(--amber);
  color: #03090f;
  border-color: var(--amber);
}
.btn-amber:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px rgba(255,179,0,0.3);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(255,51,68,0.2);
}
.btn-danger:hover {
  background: var(--red-dim);
  border-color: rgba(255,51,68,0.35);
}

.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--r-md); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-cyan   { background: rgba(0,207,255,0.09);  color: var(--cyan);   border: 1px solid rgba(0,207,255,0.18); }
.badge-amber  { background: rgba(255,179,0,0.10);  color: var(--amber);  border: 1px solid rgba(255,179,0,0.2); }
.badge-green  { background: rgba(0,232,122,0.10);  color: var(--green);  border: 1px solid rgba(0,232,122,0.2); }
.badge-red    { background: rgba(255,51,68,0.10);  color: var(--red);    border: 1px solid rgba(255,51,68,0.2); }
.badge-violet { background: rgba(124,106,255,0.10);color: var(--violet); border: 1px solid rgba(124,106,255,0.2); }
.badge-dim    { background: var(--bg-panel); color: var(--text-dim); border: 1px solid var(--border-dim); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,207,255,0.08);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }
.form-select option { background: var(--bg-panel); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }

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

th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-dim);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(24,40,64,0.5);
  vertical-align: middle;
}
tr:hover td { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid { display: grid; gap: 16px; }
.stat-grid-4 { grid-template-columns: repeat(4,1fr); }
.stat-grid-3 { grid-template-columns: repeat(3,1fr); }
.stat-grid-2 { grid-template-columns: repeat(2,1fr); }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-card);
}
.stat-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(0,207,255,0.04) inset;
}

/* Top-edge accent line — instrument indicator */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan) 40%, var(--cyan) 60%, transparent 100%);
  opacity: 0.7;
}
.stat-card.amber::before { background: linear-gradient(90deg, transparent 0%, var(--amber) 40%, var(--amber) 60%, transparent 100%); }
.stat-card.green::before  { background: linear-gradient(90deg, transparent 0%, var(--green) 40%, var(--green) 60%, transparent 100%); }
.stat-card.red::before    { background: linear-gradient(90deg, transparent 0%, var(--red) 40%, var(--red) 60%, transparent 100%); }
.stat-card.violet::before { background: linear-gradient(90deg, transparent 0%, var(--violet) 40%, var(--violet) 60%, transparent 100%); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* ============================================================
   MODULE HEADER
   ============================================================ */
.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.module-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1.2;
}
.module-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.module-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   DASHBOARD WELCOME BANNER
   ============================================================ */
.welcome-banner {
  background: linear-gradient(130deg, var(--bg-panel) 0%, #0d1e32 100%);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  padding: 30px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,207,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--cyan) 50%, transparent 100%);
}
.welcome-callsign {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.welcome-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.welcome-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   STUB / PLACEHOLDER MODULE
   ============================================================ */
.stub-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  gap: 18px;
  text-align: center;
}
.stub-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stub-icon svg { width: 36px; height: 36px; color: var(--cyan); stroke: var(--cyan); }
.stub-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.stub-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.65;
}
.stub-phase {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  padding: 5px 14px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(5px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.65), var(--shadow-glow);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-dim);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  text-transform: uppercase;
}
.modal-close {
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: color var(--t);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body    { padding: 22px 24px; }
.modal-footer  {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border-dim);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: toastin 0.28s ease;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--cyan); }
.toast-warn    { border-left: 3px solid var(--amber); }
.toast.removing { opacity: 0; transform: translateX(16px); }

@keyframes toastin {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}
.spinner-ring {
  width: 18px; height: 18px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DIVIDER & UTILITIES
   ============================================================ */
.divider { height: 1px; background: var(--border-dim); margin: 20px 0; }

.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.gap-24          { gap: 24px; }
.flex-1          { flex: 1; }
.w-full          { width: 100%; }
.text-right      { text-align: right; }
.text-center     { text-align: center; }
.text-cyan       { color: var(--cyan); }
.text-amber      { color: var(--amber); }
.text-green      { color: var(--green); }
.text-red        { color: var(--red); }
.text-dim        { color: var(--text-dim); }
.text-sm         { font-size: 12px; }
.text-xs         { font-size: 11px; }
.text-mono       { font-family: var(--font-mono); }
.text-display    { font-family: var(--font-display); }
.font-semibold   { font-weight: 600; }
.font-bold       { font-weight: 700; }
.hidden          { display: none !important; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ============================================================
   RESPONSIVE — TABLET / MOBILE
   ============================================================ */
@media (max-width: 900px) {
  .stat-grid-4 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0,0,0,0.6);
  }

  .main-content {
    margin-left: 0;
    padding-top: var(--header-h);
  }

  .content-header { display: none; }
  .module-viewport { padding: 16px; }

  .stat-grid-3 { grid-template-columns: repeat(2,1fr); }
  .stat-grid-2 { grid-template-columns: repeat(2,1fr); }

  .module-header { flex-direction: column; align-items: stretch; }
  .module-actions { justify-content: stretch; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 88vh;
  }

  .toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { min-width: unset; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-grid-4,
  .stat-grid-3,
  .stat-grid-2 { grid-template-columns: 1fr; }
  .welcome-title { font-size: 20px; }
}

/* ============================================================
   DEAL TRACKER — Phase 2
   ============================================================ */

/* Filter pills */
.deal-pill {
  padding: 5px 13px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.deal-pill:hover { color: var(--text-primary); background: var(--bg-hover); }
.deal-pill.active { color: var(--cyan); background: var(--cyan-dim); border-color: rgba(0,207,255,0.3); }

/* Pipeline board */
.pipeline-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.pipeline-board::-webkit-scrollbar { height: 5px; }
.pipeline-board::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* Pipeline column */
.pipeline-col {
  flex: 0 0 240px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  position: sticky;
  top: 0;
}
.pipeline-col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pipeline-col-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}
.pipeline-col-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 1px 7px;
}

/* Pipeline card */
.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 13px 14px;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pipeline-card:hover {
  border-color: var(--border-mid);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.pipeline-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.pipeline-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.pipeline-card-aircraft {
  font-size: 12px;
  color: var(--text-secondary);
}
.pipeline-card-tail {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 1px;
}
.pipeline-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.pipeline-meta-cell { display: flex; flex-direction: column; gap: 2px; }
.pipeline-meta-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.pipeline-meta-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.pipeline-card-loc {
  font-size: 11px;
  color: var(--text-dim);
}
.pipeline-card-advance {
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  background: transparent;
  border: 1px dashed var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
}
.pipeline-card-advance:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
}

@media (max-width: 768px) {
  .pipeline-board { flex-direction: column; }
  .pipeline-col   { flex: none; min-width: unset; width: 100%; }
}

/* ============================================================
   CRM — Phase 3
   ============================================================ */
.crm-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-hot-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.crm-hot-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.crm-hot-toggle input[type=checkbox] {
  accent-color: var(--amber);
  width: 15px; height: 15px;
  cursor: pointer;
}

/* Avatar */
.crm-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}
.crm-avatar-lg {
  width: 40px; height: 40px;
  font-size: 12px;
  border-radius: var(--r-md);
}

/* Score bar */
.crm-score-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}
.crm-score-bar {
  width: 60px; height: 4px;
  background: var(--border-dim);
  border-radius: 2px;
  overflow: hidden;
}
.crm-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.crm-score-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  min-width: 24px;
}

/* Card grid */
.crm-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.crm-contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-contact-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.crm-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crm-card-info { flex: 1; overflow: hidden; }
.crm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-card-aircraft {
  font-size: 12px;
  color: var(--text-secondary);
}
.crm-card-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.crm-card-contact-item {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CSV Drop zone */
.crm-drop-zone {
  border: 2px dashed var(--border-mid);
  border-radius: var(--r-lg);
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  transition: all var(--t);
}
.crm-drop-zone.drag-over {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

@media (max-width: 768px) {
  .crm-filterbar { flex-direction: column; align-items: stretch; }
  .crm-card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FAA RESEARCH — Phase 4
   ============================================================ */
.faa-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.faa-tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.faa-tab-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.faa-tab-btn.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: rgba(0,207,255,0.3);
}

.faa-search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 24px;
}
.faa-search-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.faa-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.faa-search-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

.faa-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.faa-result-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.faa-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.faa-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.faa-link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.faa-link-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
}
.faa-link-chip:hover {
  background: var(--cyan-dim);
  border-color: rgba(0,207,255,0.3);
  transform: translateY(-1px);
}

.faa-tip {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--amber-dim);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  line-height: 1.6;
}

/* AI response */
.faa-ai-response {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.faa-ai-response p { margin: 0 0 10px; }
.faa-ai-heading {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--cyan);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.faa-ai-num {
  display: inline;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Guide */
.faa-guide { display: flex; flex-direction: column; gap: 14px; }
.faa-guide-step {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  transition: border-color var(--t);
}
.faa-guide-step:hover { border-color: var(--border-mid); }
.faa-guide-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--cyan);
  opacity: 0.35;
  flex-shrink: 0;
  width: 36px;
  line-height: 1;
  padding-top: 2px;
}
.faa-guide-content { flex: 1; }
.faa-guide-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.faa-guide-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .faa-search-row { flex-direction: column; align-items: stretch; }
  .faa-guide-step { flex-direction: column; gap: 8px; }
  .faa-tabs { flex-direction: column; }
}

/* ============================================================
   AVA OUTREACH — Phase 5
   ============================================================ */
.ava-tabs {
  display: flex;
  gap: 8px;
}
.ava-tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: all var(--t);
}
.ava-tab-btn:hover  { background: var(--bg-hover); color: var(--text-primary); }
.ava-tab-btn.active { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(0,207,255,0.3); }

/* Placeholder */
.ava-placeholder {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.ava-placeholder-icon {
  font-size: 40px;
  color: var(--cyan);
  opacity: 0.4;
  margin-bottom: 4px;
}
.ava-placeholder-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.ava-placeholder-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.65;
}
.ava-feature-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  text-align: left;
}
.ava-feature {
  font-size: 12px;
  color: var(--green);
  font-family: var(--font-mono);
}

/* Generating */
.ava-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* Draft card */
.ava-draft-card { padding: 20px; }
.ava-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ava-draft-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
}
.ava-draft-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ava-subject-row {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.ava-subject-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.ava-subject-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ava-body-wrap {
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 16px;
  max-height: 380px;
  overflow-y: auto;
}
.ava-body-text {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.ava-draft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* History modal */
.ava-history-modal { }
.ava-history-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
  .ava-layout { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
  .ava-tabs { flex-direction: column; }
}

/* AVA — API Key setup */
.ava-key-setup {
  background: var(--amber-dim);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.ava-key-setup-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--amber);
  margin-bottom: 6px;
}
.ava-key-setup-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.ava-key-status {
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 13px;
  font-family: var(--font-mono);
}
.ava-key-ok {
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.25);
  color: var(--green);
}

/* AVA — CRM Typeahead */
.ava-suggest-box {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
}
.ava-suggest-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-dim);
  transition: background var(--t);
}
.ava-suggest-item:last-child { border-bottom: none; }
.ava-suggest-item:hover { background: var(--bg-hover); }
.ava-suggest-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.ava-suggest-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ava-suggest-meta span {
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================================================
   MORNING BRIEF — Phase 6
   ============================================================ */
.brief-welcome {
  background: linear-gradient(130deg, var(--bg-panel) 0%, #0d1e32 100%);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}
.brief-welcome::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.brief-callsign {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.brief-greeting {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.brief-date {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Two column layout */
.brief-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Deal rows */
.brief-deal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background var(--t);
  border-radius: var(--r-sm);
}
.brief-deal-row:last-child { border-bottom: none; }
.brief-deal-row:hover { background: var(--bg-hover); padding-left: 6px; }
.brief-deal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.brief-deal-ac {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Hot contacts */
.brief-contact-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--t);
}
.brief-contact-chip:hover {
  border-color: var(--border-mid);
  background: var(--bg-hover);
}
.brief-contact-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}
.brief-contact-info { flex: 1; overflow: hidden; }
.brief-contact-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brief-contact-sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Placeholder */
.brief-placeholder {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.brief-placeholder-icon {
  font-size: 36px;
  color: var(--cyan);
  opacity: 0.35;
}
.brief-placeholder-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}
.brief-placeholder-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.65;
}
.brief-no-key {
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--r-md);
  padding: 8px 14px;
}

/* AI output */
.brief-output-card { }
.brief-output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.brief-output-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--cyan);
  margin-bottom: 4px;
}
.brief-output-time {
  font-size: 11px;
  color: var(--text-dim);
}
.brief-output-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-height: 440px;
  overflow-y: auto;
}
.brief-ai-heading {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.brief-ai-num {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

@media (max-width: 900px) {
  .brief-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   COMMISSION ESTIMATOR — Phase 7
   ============================================================ */
.comm-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.comm-result-main {
  background: linear-gradient(130deg, var(--bg-panel), #0d1e32);
  border-color: rgba(0,207,255,0.18);
  text-align: center;
  padding: 28px;
}
.comm-result-label { font-family:var(--font-mono); font-size:9px; letter-spacing:2px; color:var(--text-dim); text-transform:uppercase; margin-bottom:8px; }
.comm-result-value { font-family:var(--font-display); font-size:36px; font-weight:800; color:var(--green); line-height:1; margin-bottom:6px; }
.comm-result-sub   { font-size:12px; color:var(--text-dim); }
.comm-row { display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--border-dim); font-size:13px; }
.comm-row:last-child { border-bottom:none; }
.comm-row-label { color:var(--text-secondary); }
.comm-row-value { font-family:var(--font-mono); font-weight:600; color:var(--text-primary); }
.comm-deprec-card { background:var(--cyan-dim); border-color:rgba(0,207,255,0.18); }
.comm-deprec-title { font-size:14px; font-weight:700; color:var(--cyan); margin-bottom:6px; }
.comm-deprec-sub   { font-size:13px; color:var(--text-secondary); line-height:1.6; margin-bottom:10px; }
.comm-deprec-value { font-family:var(--font-display); font-size:20px; color:var(--green); font-weight:700; margin-bottom:6px; }
.comm-deprec-note  { font-size:12px; color:var(--text-dim); line-height:1.55; }

/* ============================================================
   CALL SCRIPTS — Phase 8
   ============================================================ */
.cs-layout { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.cs-script-header { display:flex; align-items:flex-start; justify-content:space-between; padding-bottom:14px; border-bottom:1px solid var(--border-dim); margin-bottom:16px; }
.cs-script-name   { font-size:16px; font-weight:700; color:var(--text-primary); }
.cs-script-phone  { font-size:12px; color:var(--text-dim); margin-top:3px; }
.cs-script-body   { font-size:13px; line-height:1.8; color:var(--text-secondary); max-height:500px; overflow-y:auto; }
.cs-section-heading { font-family:var(--font-display); font-size:11px; letter-spacing:1.5px; text-transform:uppercase; color:var(--cyan); margin:14px 0 6px; }
.cs-bullet { display:flex; gap:8px; color:var(--text-secondary); margin:4px 0; }

/* ============================================================
   ACTIVITY LOG — Phase 9
   ============================================================ */
.al-timeline { display:flex; flex-direction:column; gap:0; }
.al-item {
  display:flex; align-items:flex-start; gap:14px;
  padding:16px 0; border-bottom:1px solid var(--border-dim);
  transition:background var(--t);
}
.al-item:hover { background:var(--bg-hover); border-radius:var(--r-md); padding-left:8px; }
.al-item:last-child { border-bottom:none; }
.al-icon { width:36px; height:36px; border-radius:var(--r-md); border:1px solid; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.al-content { flex:1; }
.al-header  { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:5px; }
.al-contact { font-size:13px; font-weight:600; color:var(--text-primary); }
.al-meta    { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.al-date    { font-size:11px; color:var(--text-dim); font-family:var(--font-mono); margin-left:auto; }
.al-notes   { font-size:13px; color:var(--text-secondary); line-height:1.55; }
.al-delete  { flex-shrink:0; opacity:0; transition:opacity var(--t); }
.al-item:hover .al-delete { opacity:1; }

/* ============================================================
   BACKUP / RESTORE — Phase 10
   ============================================================ */
.bu-layout { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.bu-preview-card { background:var(--bg-panel); border:1px solid var(--border-dim); border-radius:var(--r-md); padding:16px; }
.bu-preview-row  { display:flex; justify-content:space-between; padding:7px 0; border-bottom:1px solid var(--border-dim); font-size:12px; }
.bu-preview-row:last-child { border-bottom:none; }
.bu-danger-card  { border-color:rgba(255,68,85,0.25); }

@media (max-width:900px) {
  .comm-layout, .cs-layout, .bu-layout { grid-template-columns:1fr; }
}

/* CRM Segment Tabs */
.crm-seg-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-dim);
}
.crm-seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
}
.crm-seg-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.crm-seg-tab.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: rgba(0,207,255,0.3);
}
.crm-seg-count {
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}
.crm-seg-tab.active .crm-seg-count {
  background: rgba(0,207,255,0.12);
  border-color: rgba(0,207,255,0.2);
  color: var(--cyan);
}

/* ============================================================
   CRM SIDEBAR SUB-NAV
   ============================================================ */
.crm-subnav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 8px;
}
.crm-subnav.open {
  max-height: 400px;
  padding: 4px 8px 6px;
}

.crm-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-sub-item:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.crm-sub-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}
.crm-sub-indent {
  padding-left: 22px;
  font-size: 11px;
}

.crm-sub-group {
  padding: 8px 10px 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.crm-sub-group-list {
  list-style: none;
  padding: 0;
}

/* CRM segment badge in title */
.crm-seg-badge {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--cyan);
  margin-left: 8px;
  opacity: 0.8;
}

/* Activity Log — edit/delete actions */
.al-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t);
}
.al-item:hover .al-actions { opacity: 1; }

/* ============================================================
   PIPELINE ANALYTICS
   ============================================================ */
.analytics-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Stage bar chart */
.an-stage-chart { display: flex; flex-direction: column; gap: 10px; }
.an-stage-row   { display: flex; align-items: center; gap: 10px; }
.an-stage-label { font-size: 11px; color: var(--text-secondary); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-bar-wrap    { flex: 1; height: 6px; background: var(--border-dim); border-radius: 3px; overflow: hidden; }
.an-bar         { height: 100%; border-radius: 3px; transition: width 0.6s ease; min-width: 2px; }
.an-stage-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); width: 28px; text-align: right; flex-shrink: 0; }

/* Monthly bar chart */
.an-bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-bottom: 24px; position: relative; }
.an-bar-col   { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.an-bar-col-val { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); margin-bottom: 3px; min-height: 12px; }
.an-bar-col-bar { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.an-bar-col-fill { width: 100%; background: linear-gradient(180deg, var(--cyan) 0%, rgba(0,207,255,0.25) 100%); border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.6s ease; }
.an-bar-col-label { font-size: 8px; color: var(--text-dim); margin-top: 4px; white-space: nowrap; transform: rotate(-35deg); transform-origin: top left; position: absolute; bottom: 0; }

/* Legend */
.an-donut-wrap   { display: flex; align-items: center; gap: 20px; }
.an-donut        { width: 80px; height: 80px; border-radius: 50%; background: conic-gradient(var(--cyan) 0deg, var(--amber) 120deg, var(--violet) 240deg, var(--green) 300deg, var(--cyan) 360deg); flex-shrink: 0; box-shadow: 0 0 20px rgba(0,207,255,0.12); }
.an-legend       { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.an-legend-item  { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.an-legend-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.an-legend-label { color: var(--text-secondary); flex: 1; }
.an-legend-val   { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

/* Forecast card */
.an-forecast-row   { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-dim); }
.an-forecast-label { font-size: 13px; color: var(--text-secondary); }
.an-forecast-val   { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.an-forecast-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 0; margin-top: 4px; }

/* Metrics */
.an-metric-row   { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-dim); font-size: 13px; }
.an-metric-row:last-child { border-bottom: none; }
.an-metric-label { color: var(--text-secondary); }
.an-metric-val   { font-family: var(--font-mono); color: var(--text-primary); font-weight: 600; }

/* Deal CRM badge */
.deal-crm-badge {
  display: inline-flex;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.6;
  transition: opacity var(--t);
  vertical-align: middle;
  margin-left: 4px;
}
.deal-crm-badge:hover { opacity: 1; }

@media (max-width: 900px) {
  .analytics-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   DOCUMENT GENERATOR
   ============================================================ */
.docgen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.dg-doc-card { background: var(--bg-card); border: 1px solid var(--border-dim); border-radius: var(--r-lg); overflow: hidden; }
.dg-doc-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-dim); background: var(--bg-panel); }
.dg-doc-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--cyan); text-transform: uppercase; }
.dg-doc-body { padding: 28px 32px; font-family: Georgia, serif; font-size: 14px; line-height: 1.75; color: var(--text-primary); max-height: 70vh; overflow-y: auto; background: #f8f8f4; color: #1a1a1a; }
.dg-doc-body h1 { font-size: 16px; text-align: center; margin-bottom: 4px; }
.dg-doc-body h2 { font-size: 13px; text-align: center; color: #666; margin-bottom: 20px; }
.dg-doc-body p  { margin: 10px 0; }
.dg-doc-body .sig-line { border-top: 1px solid #999; margin-top: 32px; padding-top: 6px; width: 65%; }
.dg-doc-body hr { border: none; border-top: 1px solid #ddd; margin: 16px 0; }

@media (max-width: 900px) { .docgen-layout { grid-template-columns: 1fr; } }

/* ============================================================
   SAAS & SCALE
   ============================================================ */
.saas-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.saas-tier {
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: border-color var(--t);
}
.saas-tier::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--tier-color, var(--border-mid));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.saas-tier-current { border-color: rgba(0,207,255,0.25); background: var(--cyan-dim); }
.saas-tier-header { display: flex; align-items: baseline; justify-content: space-between; }
.saas-tier-name  { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--tier-color, var(--text-primary)); letter-spacing: 1px; }
.saas-tier-price { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text-primary); }
.saas-tier-price span { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.saas-tier-features { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.saas-tier-features li { font-size: 12px; color: var(--text-secondary); }

.saas-roadmap { display: flex; flex-direction: column; gap: 0; }
.saas-roadmap-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-dim); }
.saas-roadmap-item:last-child { border-bottom: none; }
.saas-roadmap-quarter { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-dim); width: 70px; flex-shrink: 0; padding-top: 2px; }
.saas-roadmap-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saas-roadmap-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

@media (max-width: 900px) { .saas-tiers { grid-template-columns: 1fr; } }

/* ============================================================
   TEMPLATE EDITOR
   ============================================================ */
.tmpl-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

.tmpl-list { display: flex; flex-direction: column; gap: 4px; }

.tmpl-list-item {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-dim);
  cursor: pointer;
  transition: all var(--t);
  background: var(--bg-card);
}
.tmpl-list-item:hover { border-color: var(--border-mid); background: var(--bg-hover); }
.tmpl-list-item.active { border-color: rgba(0,207,255,0.3); background: var(--cyan-dim); }

.tmpl-list-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tmpl-list-desc { font-size: 11px; color: var(--text-dim); line-height: 1.4; }

.tmpl-tip {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.12);
  border-radius: var(--r-md);
  padding: 10px 14px;
  line-height: 1.6;
  margin-top: 8px;
}

.tmpl-tab-btn { /* inherits faa-tab-btn styles */ }

@media (max-width: 900px) { .tmpl-layout { grid-template-columns: 1fr; } }

/* ============================================================
   SMART FOLLOW-UP ENGINE
   ============================================================ */
.fu-flags { display: flex; flex-direction: column; gap: 10px; }

.fu-flag-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-left: 3px solid var(--rule-color, var(--border-mid));
  border-radius: var(--r-md);
  transition: border-color var(--t), background var(--t);
}
.fu-flag-item:hover { background: var(--bg-hover); }
.fu-flag-item.fu-high {
  background: rgba(255,68,85,0.04);
  border-color: rgba(255,68,85,0.15);
  border-left-color: var(--red);
}

.fu-flag-rule {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.fu-flag-body { min-width: 0; }
.fu-flag-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.fu-flag-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 3px; }
.fu-flag-detail { font-size: 11px; font-family: var(--font-mono); }
.fu-flag-value { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; }
.fu-flag-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

/* AI Action Plan */
.fu-action-card { border-color: rgba(0,207,255,0.18); }
.fu-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-dim);
}
.fu-action-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cyan);
}
.fu-action-body {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.fu-action-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  width: 22px;
  font-weight: 700;
}

/* Settings modal rows */
.fu-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-dim);
}
.fu-settings-row:last-child { border-bottom: none; }
.fu-settings-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }

@media (max-width: 700px) {
  .fu-flag-item { grid-template-columns: 1fr auto; }
  .fu-flag-rule { writing-mode: horizontal-tb; transform: none; font-size: 8px; }
  .fu-flag-actions { flex-direction: row; }
}

/* ============================================================
   DEAL TIMELINE
   ============================================================ */

/* Deal list */
.tl-search-row { max-width: 400px; }
.tl-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tl-deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-deal-card:hover { border-color: var(--border-mid); background: var(--bg-hover); transform: translateY(-1px); }
.tl-deal-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-deal-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.tl-deal-aircraft { font-size: 12px; color: var(--text-dim); }
.tl-deal-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

/* Summary bar */
.tl-summary-bar {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tl-stat {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--border-dim);
  text-align: center;
}
.tl-stat:last-child { border-right: none; }
.tl-stat-label { font-size: 9px; font-family: var(--font-mono); letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 4px; }
.tl-stat-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* Timeline feed */
.tl-feed { position: relative; }
.tl-date-group { margin-bottom: 28px; }
.tl-date-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 0 0 12px 36px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 0;
}
.tl-event {
  display: flex;
  gap: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-dim);
  align-items: flex-start;
}
.tl-event:last-child { border-bottom: none; }
.tl-event-line {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}
.tl-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tl-event-content { flex: 1; min-width: 0; }
.tl-event-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.tl-event-icon { font-size: 15px; flex-shrink: 0; }
.tl-event-title { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.tl-event-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.tl-event-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.6; padding-left: 26px; }
.tl-event-preview {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  padding: 6px 10px;
  margin: 6px 0 0 26px;
  background: var(--bg-panel);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--border-mid);
}
.tl-event-outcome { font-size: 11px; padding-left: 26px; margin-top: 4px; }

/* Pipeline card footer */
.pipeline-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}
.pipeline-card-timeline {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  transition: all var(--t);
}
.pipeline-card-timeline:hover { border-color: var(--cyan); color: var(--cyan); }
.pipeline-card-advance { flex: 1; }

@media (max-width: 768px) { .tl-summary-bar { flex-wrap: wrap; } .tl-stat { flex: 1 1 50%; } }

/* ============================================================
   DEAL INTELLIGENCE SCORING
   ============================================================ */
.sc-mini-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}
.sc-mini-badge:hover { filter: brightness(1.3); }

.sc-deal-list { display: flex; flex-direction: column; gap: 2px; }

.sc-deal-row {
  display: grid;
  grid-template-columns: 36px 1fr 48px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t);
}
.sc-deal-row:hover { background: var(--bg-hover); }

.sc-grade-badge {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.sc-deal-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.sc-deal-sub  { font-size: 11px; color: var(--text-dim); margin: 2px 0 5px; }
.sc-bar-wrap  { height: 3px; background: var(--border-dim); border-radius: 2px; overflow: hidden; }
.sc-bar       { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.sc-score     { font-family: var(--font-display); font-size: 18px; font-weight: 800; text-align: center; }
.sc-comm      { font-family: var(--font-mono); font-size: 11px; color: var(--green); text-align: right; }

/* Score detail modal */
.sc-factors { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sc-factor-row { display: grid; grid-template-columns: 90px 1fr 30px 60px; align-items: center; gap: 8px; }
.sc-factor-label { font-size: 11px; color: var(--text-secondary); }
.sc-factor-bar-wrap { height: 4px; background: var(--border-dim); border-radius: 2px; overflow: hidden; }
.sc-factor-bar { height: 100%; border-radius: 2px; }
.sc-factor-pts { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); text-align: center; }
.sc-factor-detail { font-size: 10px; color: var(--text-dim); }
.sc-next-action { background: var(--bg-panel); border: 1px solid var(--border-dim); border-radius: var(--r-md); padding: 12px 14px; }
.sc-next-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 4px; }
.sc-next-text { font-size: 13px; color: var(--cyan); font-weight: 500; }

/* ============================================================
   BUSINESS CARD SCANNER
   ============================================================ */
.cs-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.cs-video-wrap {
  position: relative;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  margin-bottom: 14px;
}
.cs-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.cs-captured {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cs-video-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.3);
}
.cs-scan-frame {
  width: 75%;
  aspect-ratio: 1.7;
  position: relative;
}
.cs-scan-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--cyan);
  border-style: solid;
}
.cs-tl { top:0;left:0;  border-width:2px 0 0 2px; }
.cs-tr { top:0;right:0; border-width:2px 2px 0 0; }
.cs-bl { bottom:0;left:0;  border-width:0 0 2px 2px; }
.cs-br { bottom:0;right:0; border-width:0 2px 2px 0; }
.cs-scan-hint { font-size:11px;color:rgba(255,255,255,0.7);font-family:var(--font-mono);letter-spacing:1px; }

.cs-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-scanning { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--cyan); padding: 10px 0; }

.cs-placeholder {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--border-mid);
}

.cs-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cs-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
}
.cs-contact-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.cs-history-list { display: flex; flex-direction: column; gap: 8px; }
.cs-history-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-dim); }
.cs-history-item:last-child { border-bottom: none; }
.cs-hist-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.cs-hist-info { flex: 1; }
.cs-hist-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cs-hist-meta { font-size: 11px; color: var(--text-dim); }

@media (max-width: 900px) {
  .cs-layout { grid-template-columns: 1fr; }
  .sc-deal-row { grid-template-columns: 36px 1fr 40px; }
  .sc-comm { display: none; }
}

/* ============================================================
   EMAIL PLATFORM
   ============================================================ */

/* Ava — send actions */
.ava-draft-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
.ava-send-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  font-style: italic;
}

/* CRM card quick email buttons */
.crm-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
  opacity: 0;
  transition: opacity var(--t);
}
.crm-contact-card:hover .crm-card-actions { opacity: 1; }

.crm-quick-email { font-size: 11px; padding: 4px 10px; }
.crm-quick-gmail {
  font-size: 11px;
  padding: 4px 10px;
  color: var(--green);
  border-color: rgba(0,232,122,0.2);
}
.crm-quick-gmail:hover { background: var(--green-dim); border-color: rgba(0,232,122,0.35); }

.crm-quick-outlook {
  font-size: 11px;
  padding: 4px 10px;
  color: #0078d4;
  border-color: rgba(0,120,212,0.25);
}
.crm-quick-outlook:hover { background: rgba(0,120,212,0.1); border-color: rgba(0,120,212,0.4); }
