@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700&display=swap');

:root {
  --primary: #0F52BA; /* Sapphire / Zoho Blue */
  --primary-light: #EEF4FF;
  --primary-hover: #083D8D;
  --secondary: #1E293B;
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --purple: #8B5CF6;
  --purple-bg: #F5F3FF;

  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   Sidebar (Zoho Style)
-------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background-color: #0F172A;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #1E293B;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0F52BA, #3B82F6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.sidebar-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.sidebar-brand span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #94A3B8;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748B;
  padding: 12px 10px 4px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #94A3B8;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: #1E293B;
  color: #FFFFFF;
}

.nav-item.active {
  background-color: #0F52BA;
  color: #FFFFFF;
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background-color: #1E293B;
  color: #E2E8F0;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
}

.nav-item.active .nav-badge {
  background-color: rgba(255,255,255,0.2);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1E293B;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3B82F6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info {
  line-height: 1.3;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.user-role {
  font-size: 11px;
  color: #94A3B8;
}

/* -------------------------------------------------------------------------
   Main Layout & Topbar
-------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
}

.topbar {
  height: var(--topbar-h);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #F1F5F9;
  padding: 8px 14px;
  border-radius: 8px;
  width: 320px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.topbar-search:focus-within {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.1);
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
  color: var(--text-main);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-launcher .filter-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #E2E8F0;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.filter-launcher.has-filters {
  border-color: var(--primary);
  color: var(--primary);
  background: #EFF6FF;
}
.filter-launcher.has-filters .filter-count { background: var(--primary); color: #FFFFFF; }
.records-workspace {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.records-results {
  flex: 1 1 auto;
  min-width: 0;
}
.advanced-filter-panel {
  position: sticky;
  top: 10px;
  z-index: 20;
  flex: 0 0 270px;
  width: 270px;
  min-width: 270px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 210px);
  max-height: calc(100vh - 210px);
  align-self: flex-start;
  transition: flex 0.2s ease, width 0.2s ease;
}
.advanced-filter-panel.collapsed {
  display: none;
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  border: none;
}
.advanced-filter-head {
  padding: 12px 14px;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  flex-shrink: 0;
}
.advanced-filter-head strong {
  display: block;
  color: #0F172A;
  font-size: 13.5px;
  font-weight: 700;
}
.advanced-filter-head span {
  display: block;
  margin-top: 2px;
  color: #64748B;
  font-size: 11px;
}
.filter-collapse-btn {
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #64748B;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
  transition: all 0.15s;
}
.filter-collapse-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}
.advanced-filter-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.3px;
}
.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.filter-input-wrap i {
  position: absolute;
  left: 9px;
  color: #94A3B8;
  font-size: 11.5px;
  pointer-events: none;
}
.filter-input-wrap input {
  width: 100%;
  padding: 7px 8px 7px 28px;
  font-size: 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1E293B;
  outline: none;
}
.filter-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 82, 186, 0.1);
}
.filter-select {
  width: 100%;
  padding: 7px 8px;
  font-size: 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1E293B;
  outline: none;
  cursor: pointer;
}
.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 82, 186, 0.1);
}
.filter-pills-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.filter-pill-btn {
  padding: 5px 0;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.filter-pill-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.filter-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}
.filter-pill-btn.pill-hot.active {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
}
.filter-pill-btn.pill-warm.active {
  background: #D97706;
  color: #FFFFFF;
  border-color: #D97706;
}
.filter-pill-btn.pill-cold.active {
  background: #64748B;
  color: #FFFFFF;
  border-color: #64748B;
}
.filter-sort-row {
  display: grid;
  grid-template-columns: 1fr 75px;
  gap: 6px;
}
.advanced-filter-actions {
  padding: 10px 14px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

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

.btn-outline {
  background-color: white;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* -------------------------------------------------------------------------
   Page Views & Content
-------------------------------------------------------------------------- */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.view-title {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* -------------------------------------------------------------------------
   Metrics Grid (Zoho Style)
-------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pipeline-metrics { display: none; }

.metric-card {
  background: var(--bg-card);
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
}

.metric-card-action {
  cursor: pointer;
}
.metric-card-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09);
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0;
  color: var(--text-main);
}

.metric-sub {
  font-size: 12px;
  color: var(--text-light);
}

/* -------------------------------------------------------------------------
   Pipeline Kanban Board
-------------------------------------------------------------------------- */
.pipeline-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 20px 4px;
  min-height: 540px;
  align-items: flex-start;
}

#layout-kanban.hidden,
.pipeline-board.hidden {
  display: none !important;
}

#layout-table.hidden,
.data-card.hidden {
  display: none !important;
}

.kanban-col {
  flex: 0 0 300px;
  width: 300px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-top: 3px solid #0284C7;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  max-height: 800px;
}

.kanban-col[data-status="New"] { border-top-color: #3B82F6; }
.kanban-col[data-status="Contacted"] { border-top-color: #F59E0B; }
.kanban-col[data-status="In Discussion"] { border-top-color: #8B5CF6; }
.kanban-col[data-status="Quote Sent"] { border-top-color: #EC4899; }
.kanban-col[data-status="Won"] { border-top-color: #10B981; }

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid #E2E8F0;
}

.kanban-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count {
  background: #E2E8F0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding: 2px 2px 8px 2px;
}

/* Clear separated card boxes */
.lead-card,
.kanban-card {
  background: #FFFFFF;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #0284C7;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.lead-card:hover,
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -2px rgba(15, 23, 42, 0.12), 0 3px 6px -2px rgba(15, 23, 42, 0.08);
  border-color: #94A3B8;
}

/* Card internal rows & dividers */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-name {
  font-weight: 700;
  font-size: 14px;
  color: #0F172A;
}

.score-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.score-high {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}
.score-med {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}
.score-low {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #F1F5F9;
  padding-top: 8px;
  margin-top: 8px;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}
.tag-chat { background: #EDE9FE; color: #7C3AED; }
.tag-inquiry { background: #E0F2FE; color: #0284C7; }
.tag-manual { background: #F1F5F9; color: #475569; }

/* Stage-specific card left borders */
.kanban-col[data-status="New"] .lead-card { border-left-color: #3B82F6; }
.kanban-col[data-status="Contacted"] .lead-card { border-left-color: #F59E0B; }
.kanban-col[data-status="In Discussion"] .lead-card { border-left-color: #8B5CF6; }
.kanban-col[data-status="Quote Sent"] .lead-card { border-left-color: #EC4899; }
.kanban-col[data-status="Won"] .lead-card { border-left-color: #10B981; }

/* -------------------------------------------------------------------------
   Table View (Zoho Clean Table)
-------------------------------------------------------------------------- */
.data-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 215px);
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #F8FAFC;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 0 var(--border-color);
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr:hover {
  background-color: #F8FAFC;
}

.status-select {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: white;
  outline: none;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   Chat Transcripts Section
-------------------------------------------------------------------------- */
.chat-session-list {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
  height: calc(100vh - 180px);
}

.session-panel {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.session-item {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  transition: background 0.15s;
}

.session-item:hover, .session-item.active {
  background: #F8FAFC;
}

.session-item.active {
  border-left: 3px solid var(--primary);
}

.chat-viewer {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-viewer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-messages-scroll {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F8FAFC;
}

.bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 2px;
}

.bubble.assistant {
  align-self: flex-start;
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-bottom-left-radius: 2px;
}

/* -------------------------------------------------------------------------
   Modals
-------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: white;
  border-radius: 12px;
  width: 520px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(15px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal-box,
.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #F8FAFC;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.1);
}

/* -------------------------------------------------------------------------
   Heat Ranking Badges & Toggles (HOT / WARM / COLD)
-------------------------------------------------------------------------- */
.heat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.heat-pill:hover {
  filter: brightness(0.95);
  transform: scale(1.02);
}
.heat-hot {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
}
.heat-warm {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FCD34D;
}
.heat-cold {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
}

.heat-btn-group {
  display: flex;
  gap: 6px;
}
.heat-btn-group .btn-heat-choice {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.heat-btn-group .btn-heat-choice.active.choice-hot {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #B91C1C;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25);
}
.heat-btn-group .btn-heat-choice.active.choice-warm {
  background: #D97706;
  color: #FFFFFF;
  border-color: #B45309;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25);
}
.heat-btn-group .btn-heat-choice.active.choice-cold {
  background: #64748B;
  color: #FFFFFF;
  border-color: #475569;
  box-shadow: 0 2px 4px rgba(100, 116, 139, 0.25);
}
.heat-help {
  display: grid;
  gap: 3px;
  margin-top: 7px;
  color: #64748B;
  font-size: 10.5px;
  line-height: 1.35;
}
.heat-help span {
  display: block;
}

/* Heat filter bar */
.heat-filter-bar {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.heat-filter-bar .filter-tab {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.heat-filter-bar .filter-tab.active {
  background: #FFFFFF;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* -------------------------------------------------------------------------
   Activity Reminders
-------------------------------------------------------------------------- */
.reminder-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.3;
}
.reminder-more {
  border-left: 1px solid currentColor;
  margin-left: 2px;
  padding-left: 6px;
  font-weight: 700;
}
.reminder-upcoming {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.reminder-overdue {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.lead-reminders-box {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
}
.lead-reminders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  max-height: 190px;
  overflow-y: auto;
}
.modal-box-reminders {
  width: min(680px, 94vw);
  max-width: 680px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.reminder-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 8px;
  align-self: flex-start;
}
.reminder-view-tabs .filter-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 5px 12px;
  color: #64748B;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.reminder-view-tabs .filter-tab.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.all-reminders-list {
  overflow-y: auto;
  min-height: 260px;
  max-height: 58vh;
}
.reminder-group + .reminder-group {
  margin-top: 14px;
}
.reminder-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 7px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.reminder-group-title span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 10px;
  background: #E2E8F0;
  text-align: center;
  font-size: 10px;
}
.reminder-group-title.overdue {
  color: #B91C1C;
}
.reminder-group-title.today {
  color: #1D4ED8;
}
.reminder-task {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #FFFFFF;
  margin-bottom: 6px;
}
.reminder-task.is-overdue {
  border-color: #FECACA;
  background: #FFF7F7;
}
.reminder-task.is-completed {
  opacity: 0.66;
}
.reminder-task.is-completed .reminder-task-title {
  text-decoration: line-through;
}
.reminder-check,
.reminder-delete,
.reminder-lead-link {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.reminder-check {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  color: #94A3B8;
}
.is-completed .reminder-check {
  border-color: #86EFAC;
  background: #DCFCE7;
  color: #15803D;
}
.reminder-task-main {
  flex: 1;
  min-width: 0;
}
.reminder-lead-link {
  padding: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}
.reminder-task-title {
  margin-top: 1px;
  color: #1E293B;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.reminder-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 3px;
  color: #64748B;
  font-size: 10.5px;
}
.reminder-delete {
  padding: 3px;
  color: #94A3B8;
  font-size: 11px;
}
.reminder-delete:hover {
  color: #DC2626;
}
.empty-state-compact {
  padding: 18px 8px;
  color: #94A3B8;
  text-align: center;
  font-size: 11.5px;
}

/* -------------------------------------------------------------------------
   Running Activities Timeline & Modal Layout
-------------------------------------------------------------------------- */
.modal-box.modal-box-wide {
  max-width: 960px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-split-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  overflow: hidden;
  max-height: calc(85vh - 120px);
}
@media (max-width: 860px) {
  .modal-split-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }
}
.modal-split-left {
  overflow-y: auto;
  padding-right: 12px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-split-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Timeline Box */
.activity-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.activity-type-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  background: white;
  cursor: pointer;
}
.activity-type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.timeline-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  position: relative;
  border-left: 3px solid var(--primary);
}
.timeline-card.type-quote { border-left-color: #EC4899; }
.timeline-card.type-ai { border-left-color: #8B5CF6; }
.timeline-card.type-call { border-left-color: #F59E0B; }
.timeline-card.type-inquiry { border-left-color: #3B82F6; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.timeline-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.timeline-price {
  font-size: 12px;
  font-weight: 800;
  color: #059669;
  background: #ECFDF5;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #A7F3D0;
}
.timeline-content {
  font-size: 12.5px;
  line-height: 1.45;
  color: #1E293B;
  white-space: pre-wrap;
  word-break: break-word;
}
.timeline-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-light);
}

.btn-purple {
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
  border: none;
}
.btn-purple:hover {
  filter: brightness(0.95);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* Session Activity & Conversion Badges */
.session-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
}
.session-status-badge.session-live {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}
.session-status-badge.session-idle {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}
.status-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse-live 1.8s infinite;
}
@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Client Relationship Badges (For Contacts Directory - No Heat!) */
.client-rel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 14px;
}
.client-rel-vip {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.client-rel-active {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}
.client-rel-quote {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.client-rel-prospect {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.client-rel-inactive {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

/* Chat Viewer Message Bubbles */
.msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.msg-bubble.msg-user {
  align-self: flex-end;
  background: #0284C7;
  color: white;
  border-bottom-right-radius: 2px;
}
.msg-bubble.msg-bot {
  align-self: flex-start;
  background: white;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border-bottom-left-radius: 2px;
}

/* -------------------------------------------------------------------------
   Zoho-style full lead record
-------------------------------------------------------------------------- */
.clickable-lead-row {
  cursor: pointer;
}
.clickable-lead-row:hover td {
  background: #F8FAFF;
}
.selection-column {
  width: 42px;
  min-width: 42px;
  text-align: center !important;
}
.selection-column input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #4F46E5;
  cursor: pointer;
}
.bulk-action-bar {
  min-height: 0;
  max-height: 0;
  padding: 0 16px;
  border-bottom: 0 solid #DDE3ED;
  background: #F5F7FF;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.18s ease, min-height 0.18s ease, opacity 0.15s ease, padding 0.18s ease;
  font-size: 12px;
}
.bulk-action-bar.active {
  min-height: 48px;
  max-height: 58px;
  padding: 7px 16px;
  border-bottom-width: 1px;
  opacity: 1;
}
.bulk-action-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bulk-action-bar strong {
  min-width: 22px;
  height: 22px;
  padding: 2px 6px;
  border-radius: 11px;
  background: #4F46E5;
  color: #FFFFFF;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}
.btn-danger {
  border: 1px solid #DC2626;
  background: #DC2626;
  color: #FFFFFF;
}
.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}
.record-overlay {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.48);
}
.lead-record-modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  background: #F6F8FC;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .24);
  overflow: hidden;
}
.record-header {
  min-height: 72px;
  padding: 12px 20px;
  border-bottom: 1px solid #DDE3ED;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.record-back,
.record-close {
  width: 34px;
  height: 34px;
  border: 1px solid #D8E0EC;
  border-radius: 7px;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
}
.record-back:hover,
.record-close:hover {
  background: #F1F5F9;
  color: var(--primary);
}
.record-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #E9EDFF;
  color: #4F46E5;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
}
.record-heading {
  min-width: 0;
  flex: 1;
}
.record-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.record-title-line h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  line-height: 1.2;
}
.record-subtitle {
  margin-top: 4px;
  color: #718096;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-source-pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 12px;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 10.5px;
  font-weight: 700;
}
.record-add-tag {
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
}
.record-add-tag:hover { color: #2563EB; }
.record-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.record-header-actions .btn { padding: 7px 13px; border-radius: 5px; }
.record-header-actions .disabled { opacity: .5; pointer-events: none; }
.record-more-wrap { position: relative; }
.record-more {
  width: 36px;
  height: 34px;
  border: 1px solid #D8E0EC;
  border-radius: 6px;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
}
.record-more-menu {
  position: absolute;
  z-index: 10;
  top: 40px;
  right: 0;
  width: 160px;
  padding: 5px;
  border: 1px solid #DDE3ED;
  border-radius: 7px;
  background: #FFFFFF;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  display: none;
}
.record-more-menu.open { display: block; }
.record-more-menu button {
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  display: flex;
  gap: 8px;
  cursor: pointer;
  font-size: 11.5px;
  text-align: left;
}
.record-more-menu button:hover { background: #F1F5F9; }
.record-more-menu button.danger { color: #DC2626; }
.record-tabs {
  height: 50px;
  padding: 7px 20px 7px 112px;
  border-bottom: 1px solid #DDE3ED;
  background: #F2F5FA;
  display: flex;
  align-items: center;
  gap: 3px;
}
.record-tab {
  height: 34px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #FFFFFF;
  color: #526174;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
}
.record-tab.active {
  border-color: #AFC2FF;
  background: #EEF2FF;
  color: #3730A3;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.record-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.record-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 48px;
}
.record-section {
  display: block;
  width: min(1200px, 100%);
  margin: 0 auto;
}
.record-section-heading {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.record-section-heading h3 {
  margin: 0;
  color: #273449;
  font-size: 13px;
  font-weight: 800;
}
.record-section-heading span {
  color: #94A3B8;
  font-size: 10.5px;
}
.record-overview-card {
  margin-bottom: 14px;
  padding: 18px 22px;
  border: 1px solid #DFE5EE;
  border-radius: 8px;
  background: #FFFFFF;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  row-gap: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}
.record-field {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 34px;
}
.record-field-wide {
  grid-column: 1 / -1;
  align-items: start;
}
.record-field-wide > label {
  padding-top: 8px;
}
.record-field label {
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}
.record-input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #273449;
  font-family: inherit;
  font-size: 12.5px;
}
.record-input:hover,
.record-input:focus {
  border-color: #C7D2FE;
  background: #FAFBFF;
  outline: none;
}
.lead-record-modal:not(.editing) .record-input {
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  background: transparent;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}
.lead-record-modal:not(.editing) input[type="number"]::-webkit-inner-spin-button,
.lead-record-modal:not(.editing) input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
.lead-record-modal:not(.editing) .record-textarea { resize: none; }
.lead-record-modal:not(.editing) .heat-btn-group { pointer-events: none; }
.lead-record-modal:not(.editing) .record-footer { display: none; }
.lead-record-modal.editing #record-edit-button { display: none; }
.lead-record-modal.editing #record-send-email { display: none; }
.record-textarea {
  resize: vertical;
  line-height: 1.45;
}
.record-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  cursor: pointer;
  text-align: left !important;
}
.record-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.record-toggle span {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #CBD5E1;
  transition: .18s ease;
}
.record-toggle span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
  transition: .18s ease;
}
.record-toggle input:checked + span { background: #16A34A; }
.record-toggle input:checked + span::after { transform: translateX(16px); }
.record-toggle em { color: #475569; font-size: 12px; font-style: normal; font-weight: 600; }
.lead-record-modal:not(.editing) .record-toggle { cursor: default; }
.running-log-heading { margin-top: 8px; }
.activity-price-hidden { display: none; }
.activity-compose-fields:has(.activity-price-hidden) { grid-template-columns: minmax(240px, 1fr) auto; }
.unsubscribed-badge {
  width: max-content;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid #FECACA;
  border-radius: 10px;
  background: #FEF2F2;
  color: #B91C1C;
  font-size: 9px;
  font-weight: 700;
}
.heat-record-card {
  display: block;
}
.heat-record-card .heat-btn-group {
  max-width: 500px;
}
.record-related-data {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #EDF0F5;
}
.record-collected-title,
.record-data-title {
  margin-bottom: 10px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.record-collected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 28px;
}
.record-collected-grid div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  font-size: 11.5px;
}
.record-collected-grid span {
  color: #7C8A9D;
}
.record-collected-grid strong {
  color: #334155;
  font-weight: 650;
}
.record-activity-compose,
.record-reminder-compose {
  background: #FFFFFF;
  border-color: #DDE3ED;
}
.activity-compose-head {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #273449;
  font-size: 12px;
}
.activity-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.activity-compose-fields {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) auto;
  gap: 8px;
}
.reminder-compose-fields {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(200px, 1fr) auto;
  gap: 8px;
}
.record-timeline,
.record-reminders-list {
  max-height: none;
  overflow: visible;
}
.record-timeline .timeline-card {
  padding: 14px 16px;
}
.record-data-stack + .record-data-stack {
  margin-top: 18px;
}
.inquiry-detail-card,
.record-chat-card {
  margin-bottom: 12px;
  border: 1px solid #DFE5EE;
  border-radius: 8px;
  background: #FFFFFF;
  overflow: hidden;
}
.inquiry-detail-head,
.record-chat-head {
  padding: 11px 14px;
  border-bottom: 1px solid #EDF0F5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #273449;
  font-size: 12px;
}
.inquiry-detail-head span,
.record-chat-head span {
  color: #7C8A9D;
  font-size: 10.5px;
}
.inquiry-detail-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
.inquiry-detail-grid label {
  color: #7C8A9D;
  font-size: 10.5px;
  font-weight: 700;
}
.inquiry-detail-grid p {
  margin: 4px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.record-chat-meta {
  padding: 8px 14px;
  background: #F8FAFC;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.record-chat-meta span {
  padding: 3px 7px;
  border-radius: 10px;
  background: #E9EEF7;
  color: #526174;
  font-size: 10px;
}
.record-chat-messages {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.record-chat-message {
  max-width: 78%;
}
.record-chat-message.from-customer {
  align-self: flex-end;
}
.record-chat-message span {
  display: block;
  margin: 0 4px 3px;
  color: #94A3B8;
  font-size: 9.5px;
  font-weight: 700;
}
.record-chat-message.from-customer span {
  text-align: right;
}
.record-chat-message p {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  background: #F8FAFC;
  color: #334155;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.record-chat-message.from-customer p {
  border-color: #C7D2FE;
  background: #EEF2FF;
}
.record-empty {
  padding: 24px;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  color: #94A3B8;
  text-align: center;
  font-size: 11.5px;
}
.record-footer {
  min-height: 58px;
  padding: 10px 20px;
  border-top: 1px solid #DDE3ED;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.record-footer > div {
  display: flex;
  gap: 8px;
}
@media (max-width: 900px) {
  .records-workspace { flex-direction: column; }
  .advanced-filter-panel.open { width: 100%; min-width: 100%; max-height: none; flex-basis: auto; }
  .record-overlay { padding: 0; }
  .lead-record-modal { border-radius: 0; }
  .record-header { padding: 10px 12px; }
  .record-header-actions .btn-outline { display: none; }
  .record-tabs { padding-left: 12px; overflow-x: auto; }
  .record-layout { grid-template-columns: 1fr; }
  .record-related-list { display: flex; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid #DDE3ED; overflow-x: auto; }
  .related-title { display: none; }
  .related-link { width: auto; flex: 0 0 auto; }
  .record-content { padding: 12px; }
  .record-overview-card { grid-template-columns: 1fr; padding: 14px; }
  .record-field-wide { grid-column: auto; }
  .record-field { grid-template-columns: 100px minmax(0, 1fr); }
  .record-collected-grid, .inquiry-detail-grid { grid-template-columns: 1fr; }
  .activity-compose-fields, .reminder-compose-fields { grid-template-columns: 1fr; }
}
