/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --radius: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Header */
.header {
  background: var(--bg-card);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-result-item:hover {
  background: var(--bg);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item .name {
  font-weight: 500;
}

.search-result-item .meta {
  font-size: 12px;
  color: var(--text-light);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* User Menu */
.user-menu {
  position: relative;
  margin-left: 8px;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.user-btn:hover {
  background: var(--border);
}

.user-icon {
  font-size: 16px;
}

.user-email {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  display: none;
  z-index: 300;
}

.user-dropdown.active {
  display: block;
}

.user-dropdown-email {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--bg);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

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

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

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

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

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

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-tiny {
  padding: 2px 6px;
  font-size: 11px;
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Content */
.content {
  padding: 20px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Leads Container */
.leads-container {
  display: grid;
  grid-template-columns: 1fr 550px;
  gap: 20px;
  height: calc(100vh - 180px);
}

.leads-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border);
}

.list-header h2 {
  font-size: 16px;
  font-weight: 600;
}

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  padding: 10px 15px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filters select,
.filters input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-card);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Tables */
.table-container {
  flex: 1;
  overflow: auto;
}

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

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  position: sticky;
  top: 0;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

th.sortable:hover {
  background: var(--border);
}

th.sortable::after {
  content: '';
  display: inline-block;
  margin-left: 5px;
  width: 0;
  height: 0;
  vertical-align: middle;
}

th.sort-asc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--primary);
}

th.sort-desc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--primary);
}

tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

tbody tr:hover {
  background: var(--bg);
}

tbody tr.selected {
  background: #dbeafe;
}

/* Lead Detail */
.lead-detail {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-light);
}

.detail-content {
  padding: 20px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.detail-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-name {
  font-size: 20px;
  font-weight: 600;
}

.detail-name.clickable,
.value.clickable {
  cursor: pointer;
}

.detail-name.clickable:hover,
.value.clickable:hover {
  color: var(--primary);
}

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

.lost-reason {
  font-size: 11px;
  color: var(--danger);
  margin-top: -15px;
  margin-bottom: 15px;
}

.detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Detail Sections */
.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.section-header h4 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-field {
  font-size: 13px;
}

.detail-field .label {
  color: var(--text-light);
  font-size: 11px;
}

.detail-field .value {
  font-weight: 500;
  white-space: pre-wrap;
}

.secondary-info {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  opacity: 0.85;
}

.secondary-info .detail-field .label {
  font-size: 10px;
}

.secondary-info .detail-field .value {
  font-size: 12px;
  font-weight: normal;
}

.appt-stats {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.detail-footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  padding: 5px 10px;
}

.btn-link-danger:hover {
  color: var(--danger);
  text-decoration: underline;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.tag-new { background: #f1f5f9; color: #475569; }
.tag-ttv { background: #fce7f3; color: #9d174d; }
.tag-gb { background: #dbeafe; color: #1e40af; }
.tag-ft { background: #ede9fe; color: #5b21b6; }
.tag-at { background: #cffafe; color: #0e7490; }
.tag-concept { background: #fef3c7; color: #92400e; }
.tag-client { background: #dcfce7; color: #166534; }
.tag-lost { background: #fee2e2; color: #991b1b; }

.label-tag { background: #e5e7eb; color: #4b5563; }

.tag-pending { background: #fef3c7; color: #92400e; }
.tag-proposed { background: #dbeafe; color: #1e40af; }
.tag-closed { background: #dcfce7; color: #166534; }
.tag-rejected { background: #fee2e2; color: #991b1b; }
.tag-cancelled { background: #f3f4f6; color: #4b5563; }

/* Concepts Container */
.concepts-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
}

.concepts-summary {
  display: flex;
  gap: 15px;
  margin: 15px 0;
}

.summary-card {
  background: var(--bg);
  padding: 12px 20px;
  border-radius: var(--radius);
  text-align: center;
}

.summary-card .label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
}

.summary-card .value {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
}

/* Stats Container */
.stats-container h2 {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.stats-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
  .stats-grid.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.date-range {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  display: block;
  margin-top: 2px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-card > h3 + * {
  flex: 1;
  min-height: 0;
}

.stat-card > h3 + .chart-container {
  flex: 0 0 250px;
  min-height: 250px;
}

.stat-card.wide {
  grid-column: span 2;
}

.stat-card.funnel-card {
  grid-row: span 2;
}

.stat-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-light);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row.highlight {
  background: var(--bg);
  margin: 10px -20px -20px;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.stat-row.highlight strong {
  color: var(--primary);
  font-size: 18px;
}

/* Funnel Filter */
.funnel-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.funnel-filter label {
  font-size: 13px;
  color: var(--text-secondary);
}

.funnel-filter select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  min-width: 150px;
}

/* Funnel Row (side by side) */
.funnel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Funnel Chart */
.funnel-chart {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.funnel-group-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 2px;
}

.funnel-group-label:first-child {
  margin-top: 0;
}

.funnel-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s;
}

.funnel-stage:not(.funnel-total):hover {
  transform: translateX(4px);
}

.funnel-stage.funnel-dim {
  opacity: 0.4;
}

.funnel-stage.funnel-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.funnel-label {
  width: 70px;
  font-size: 12px;
  font-weight: 500;
}

.funnel-total .funnel-label {
  font-weight: 700;
}

.funnel-bar {
  flex: 1;
  height: 22px;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.funnel-fill {
  height: 100%;
  border-radius: var(--radius);
  transition: width 0.3s;
}

.funnel-count {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
}

.funnel-pct {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}

.funnel-dropoff {
  font-weight: 500;
  color: var(--danger);
  font-size: 10px;
  margin-left: 4px;
}

.funnel-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.funnel-bar-wrapper .funnel-bar {
  flex: none;
}

.funnel-time-row {
  font-size: 10px;
  font-weight: 500;
  padding-left: 4px;
  line-height: 1.2;
}

.funnel-time-row.time-good {
  color: #22c55e;
}

.funnel-time-row.time-warn {
  color: #f59e0b;
}

.funnel-time-row.time-bad {
  color: #ef4444;
}

.funnel-total .funnel-count {
  font-weight: 700;
  color: white;
}

/* Professional Sales Funnel */
.pro-funnel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.pro-funnel-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.pro-funnel-row.funnel-dim {
  opacity: 0.5;
}

.pro-funnel-label {
  width: 80px;
  min-width: 80px;
  text-align: right;
  font-weight: 600;
  font-size: 11px;
  color: #64748b;
}

.pro-funnel-bar-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.pro-funnel-bar {
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pro-funnel-bar:hover {
  transform: scaleX(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pro-funnel-bar.pro-funnel-total {
  cursor: default;
}

.pro-funnel-bar.pro-funnel-total:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pro-funnel-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 120px;
  min-width: 120px;
}

.pro-funnel-count {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.pro-funnel-pct {
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
}

.pro-funnel-dropoff {
  font-weight: 600;
  color: #dc2626;
  font-size: 10px;
  background: #fee2e2;
  padding: 2px 5px;
  border-radius: 3px;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding-top: 20px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar {
  width: 100%;
  max-width: 40px;
  background: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: height 0.3s;
}

.bar-label {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 5px;
  text-align: center;
}

.bar-value {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 5px;
}

/* Revenue Year-Month Grid Table */
.revenue-grid-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}

.revenue-grid-table th,
.revenue-grid-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.revenue-grid-table th {
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg);
}

.revenue-grid-table .year-label {
  font-weight: 600;
  text-align: left;
  padding-left: 8px;
}

.revenue-grid-table .year-total {
  font-weight: 700;
  background: var(--bg);
  color: var(--primary);
}

.revenue-grid-table .has-value {
  color: var(--success);
  font-weight: 500;
}

.revenue-grid-table .zero-value {
  color: var(--text-light);
}

.revenue-grid-table tbody tr:hover {
  background: var(--bg);
}

.revenue-grid-table .type-label {
  font-weight: 500;
  text-align: left;
  padding-left: 8px;
  white-space: nowrap;
}

.revenue-grid-table .type-label.closed {
  color: var(--success);
}

.revenue-grid-table .type-label.cancelled {
  color: var(--danger);
}

.revenue-grid-table .type-label.net {
  color: var(--primary);
  font-weight: 700;
}

.revenue-grid-table .has-value.cancelled {
  color: var(--danger);
}

.revenue-grid-table .has-value.net {
  color: var(--primary);
  font-weight: 600;
}

.revenue-grid-table .has-value.net.negative {
  color: var(--danger);
}

.revenue-grid-table .year-total.closed {
  color: var(--success);
}

.revenue-grid-table .year-total.cancelled {
  color: var(--danger);
}

.revenue-grid-table .year-total.net {
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
}

.revenue-grid-table .net-row {
  border-bottom: 2px solid var(--border);
}

/* Mini Table */
.mini-table {
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 6px 8px;
}

.text-light {
  color: var(--text-light);
  font-size: 11px;
}

/* WVL List */
.wvl-section {
  margin-bottom: 15px;
}

.wvl-section h4 {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.wvl-list {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
}

.wvl-list li {
  padding: 6px 8px;
  background: var(--bg);
  margin-bottom: 4px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
}

.wvl-list li:hover {
  background: var(--border);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
}

.close-btn:hover {
  color: var(--text);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 20px;
}

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

.form-group.full-width {
  grid-column: span 2;
}

.form-group.checkboxes {
  grid-column: span 2;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 15px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
}

.form-group.checkboxes label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.form-group.lost-section {
  background: #fef2f2;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
}

.checkbox-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  margin-right: 10px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input.readonly-date {
  background: var(--bg);
  color: var(--text-light);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Autocomplete */
.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.autocomplete-results.active {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: var(--bg);
}

/* Import Options */
.import-options {
  padding: 20px;
  text-align: center;
}

.import-options p {
  margin-bottom: 15px;
}

.import-options .btn {
  margin: 5px;
}

.import-options .warning {
  color: var(--danger);
  font-size: 12px;
  margin-top: 15px;
}

/* Lost Reason Modal */
.lost-reason-options {
  padding: 20px;
  text-align: center;
}

.lost-reason-options p {
  margin-bottom: 15px;
  color: var(--text-light);
}

.lost-reason-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lost-btn {
  padding: 15px 20px;
  font-size: 14px;
  text-align: center;
}

/* Concepts in Detail */
.concepts-list {
  margin-top: 10px;
}

/* Call Log */
.call-log {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px;
}

/* Created By indicator */
.created-by {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

/* Appointments Log */
.appointments-log {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px;
}

/* Schedule Appointment Form */
.appointment-schedule-form {
  padding: 20px;
}

.appointment-schedule-form .form-group {
  margin-bottom: 15px;
}

.appointment-schedule-form .form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-light);
}

.appointment-schedule-form input[type="datetime-local"],
.appointment-schedule-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.appointment-schedule-form input:focus,
.appointment-schedule-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-actions-inline {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

/* Outcome Buttons for Modals */
.outcome-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
}

.outcome-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 15px 20px;
  min-width: 100px;
}

.outcome-btn.selected {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.outcome-icon {
  font-size: 20px;
  font-weight: bold;
}

.comment-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.comment-section label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.comment-section textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 10px;
  resize: vertical;
}

.comment-section textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.call-log-options,
.appointment-log-options {
  padding: 20px;
  text-align: center;
}

.call-log-options p,
.appointment-log-options p {
  margin-bottom: 10px;
  color: var(--text-light);
}

/* Conversion Rate */
.conversion-rate {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.conversion-rate strong {
  color: var(--success);
  font-size: 18px;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

/* Dashboard Section Container */
.dashboard-section {
  margin-bottom: 30px;
}

.dashboard-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

/* Task List Styling */
.task-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.task-list li {
  padding: 8px 10px;
  background: var(--bg);
  margin-bottom: 4px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: background 0.15s;
}

.task-list li:hover {
  background: var(--border);
}

.task-list li:last-child {
  margin-bottom: 0;
}

.task-list .task-name {
  font-weight: 500;
  flex: 1;
}

.task-list .task-meta {
  color: var(--text-light);
  font-size: 11px;
  margin-left: 10px;
}

.task-list .task-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.task-list .task-note {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Urgent Card (Overdue WVL) */
.stat-card.urgent {
  border-left: 4px solid var(--danger);
}

.stat-card.urgent h3 {
  color: var(--danger);
}

/* Task Management Grid */
.task-management-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.task-card-header h3 {
  margin: 0;
  font-size: 13px;
}

.task-filter-select {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.task-filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.task-management-grid .stat-card {
  padding: 12px;
}

.task-management-grid .task-list {
  max-height: 200px;
  overflow-y: auto;
}

/* At-risk badge */
.at-risk-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 600;
  background: var(--danger);
  color: white;
  border-radius: 3px;
  margin-left: 6px;
}

/* Responsive: 2 columns on smaller screens */
@media (max-width: 1200px) {
  .task-management-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .task-management-grid {
    grid-template-columns: 1fr;
  }
}

/* Appointment Stats Grid (3x2 for week/month/year stats) */
.appt-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Appointment Breakdown Container (for new table layout) */
.appt-breakdown-container {
  display: block;
}

.appt-stat-item {
  text-align: center;
  padding: 12px 10px;
  background: var(--bg);
  border-radius: var(--radius);
}

.appt-stat-item .value {
  font-size: 24px;
  font-weight: 600;
  display: block;
}

.appt-stat-item .label {
  font-size: 11px;
  color: var(--text-light);
  display: block;
  margin-top: 2px;
}

.appt-stat-item.success .value {
  color: var(--success);
}

.appt-stat-item.danger .value {
  color: var(--danger);
}

.appt-stat-item.highlight {
  background: var(--primary);
  color: white;
}

.appt-stat-item.highlight .value {
  color: white;
}

.appt-stat-item.highlight .label {
  color: rgba(255,255,255,0.8);
}

/* Show Rate large display */
.show-rate-display {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.show-rate-display .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.show-rate-display .label {
  font-size: 12px;
  color: var(--text-light);
}

/* Appointment Breakdown Table */
.appt-breakdown-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.appt-breakdown-table th {
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  padding: 8px 4px;
  font-size: 10px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.appt-breakdown-table th:first-child {
  text-align: left;
  width: 50px;
}

.appt-breakdown-table td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.appt-breakdown-table .label-cell {
  font-weight: 600;
  text-align: left;
  color: var(--primary);
}

.appt-breakdown-table .total-cell {
  font-weight: 600;
}

.appt-breakdown-table .attended-cell {
  color: var(--success);
}

.appt-breakdown-table .missed-cell {
  color: var(--danger);
}

.appt-breakdown-table .pct {
  font-size: 10px;
  color: var(--text-light);
}

.appt-breakdown-table .total-row {
  background: var(--bg);
  font-weight: 600;
}

.appt-breakdown-table .total-row .label-cell {
  color: var(--text);
}

.appt-breakdown-table tbody tr:hover {
  background: var(--bg);
}

/* Concepts Dashboard */
.concepts-breakdown-container {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  height: 100%;
  min-height: 300px;
}

.concept-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.concept-section:last-child {
  margin-bottom: 0;
}

.concept-section .concepts-breakdown-table {
  flex: 1;
  overflow-y: auto;
}

.concept-section h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.concepts-breakdown-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.concepts-breakdown-table th {
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  padding: 6px 4px;
  font-size: 10px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.concepts-breakdown-table th:first-child {
  text-align: left;
  width: 80px;
}

.concepts-breakdown-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.concepts-breakdown-table .label-cell {
  font-weight: 600;
  text-align: left;
  color: var(--primary);
}

.concepts-breakdown-table .total-cell {
  font-weight: 600;
}

.concepts-breakdown-table .closed-cell {
  color: var(--success);
}

.concepts-breakdown-table .rejected-cell {
  color: var(--danger);
}

.concepts-breakdown-table .cancelled-cell {
  color: var(--warning);
}

.concepts-breakdown-table .eh-cell {
  font-weight: 600;
  color: var(--primary);
}

.concepts-breakdown-table .pct {
  font-size: 10px;
  color: var(--text-light);
}

.concepts-breakdown-table .total-row {
  background: var(--bg);
  font-weight: 600;
}

.concepts-breakdown-table .total-row .label-cell {
  color: var(--text);
}

.concepts-breakdown-table tbody tr:hover {
  background: var(--bg);
}

.concepts-breakdown-table .empty-state {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  padding: 12px;
}

/* Show Rate Badge */
.show-rate-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--primary);
  border-radius: var(--radius);
  color: white;
}

.show-rate-badge .rate-value {
  font-size: 20px;
  font-weight: 700;
}

.show-rate-badge .rate-label {
  font-size: 11px;
  opacity: 0.9;
}

/* EH Summary Grid */
.eh-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eh-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.eh-row:last-child {
  border-bottom: none;
}

.eh-row .eh-label {
  color: var(--text-light);
  font-size: 13px;
}

.eh-row .eh-value {
  font-weight: 600;
  font-size: 16px;
}

.eh-row.cancelled .eh-value {
  color: var(--danger);
}

.eh-row.net {
  background: var(--bg);
  margin: 10px -20px -20px;
  padding: 15px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  border-bottom: none;
}

.eh-row.net .eh-label {
  font-weight: 600;
  color: var(--text);
}

.eh-row.net .eh-value {
  font-size: 20px;
  color: var(--success);
}

/* Top Clients List */
.top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: top-counter;
}

.top-list li {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  counter-increment: top-counter;
}

.top-list li:hover {
  background: var(--bg);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.top-list li:last-child {
  border-bottom: none;
}

.top-list li::before {
  content: counter(top-counter) ".";
  width: 24px;
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
}

.top-list .client-name {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
}

.top-list .client-eh {
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-light);
  font-size: 13px;
}

.empty-state-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 250px;
  min-height: 250px;
  flex-shrink: 0;
}

/* Enhanced Mini Table for Dashboard */
.dashboard-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.dashboard-table th {
  background: var(--bg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--text-light);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.dashboard-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.dashboard-table tr:hover {
  background: var(--bg);
}

.dashboard-table .text-right {
  text-align: right;
}

.dashboard-table .text-center {
  text-align: center;
}

.dashboard-table .highlight-value {
  font-weight: 600;
  color: var(--primary);
}

.dashboard-table .positive {
  color: var(--success);
}

.dashboard-table .negative {
  color: var(--danger);
}

/* Week/Month Period Badge */
.period-badge {
  font-size: 10px;
  color: var(--text-light);
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* Analytics Controls */
.analytics-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}

.filter-btn:hover {
  background: var(--border);
}

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

.date-range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range-picker span {
  color: var(--text-light);
  font-size: 12px;
}

.date-input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--bg-card);
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-apply {
  padding: 6px 14px;
  font-size: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-apply:hover {
  background: var(--primary-dark, #1d4ed8);
}

/* Activity Analytics Grid (side-by-side layout) */
.activity-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.activity-analytics-grid .stat-card {
  margin: 0;
  padding: 15px;
}

.activity-analytics-grid .stat-card h3 {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Compact controls - single row with wrapping */
.activity-analytics-grid .analytics-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.activity-analytics-grid .quick-filters {
  display: flex;
  gap: 3px;
}

.activity-analytics-grid .filter-btn {
  padding: 3px 7px;
  font-size: 10px;
}

.activity-analytics-grid .date-range-picker {
  display: flex;
  align-items: center;
  gap: 4px;
}

.activity-analytics-grid .date-range-picker span {
  font-size: 10px;
}

.activity-analytics-grid .date-input {
  padding: 3px 5px;
  font-size: 10px;
  width: 90px;
}

.activity-analytics-grid .btn-apply {
  padding: 3px 8px;
  font-size: 10px;
}

.activity-analytics-grid .analytics-table {
  font-size: 11px;
}

.activity-analytics-grid .analytics-table th,
.activity-analytics-grid .analytics-table td {
  padding: 5px 6px;
}

.activity-analytics-grid .analytics-summary {
  padding: 10px;
  gap: 6px;
  margin-top: 10px;
}

.activity-analytics-grid .summary-item .value {
  font-size: 16px;
}

.activity-analytics-grid .summary-item .label {
  font-size: 9px;
}

.activity-analytics-grid .analytics-content {
  min-height: auto;
}

.activity-analytics-grid .analytics-date-range {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

/* View Selector - compact inline */
.view-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.view-selector label {
  font-size: 10px;
  color: var(--text-light);
}

.view-selector select {
  padding: 3px 5px;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.view-selector select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1400px) {
  .activity-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

.analytics-content {
  min-height: 200px;
}

.analytics-date-range {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* KPI Cards - Compact horizontal layout */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
}

.kpi-card.wide {
  grid-column: span 2;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.kpi-value.primary {
  color: var(--primary);
}

.kpi-value.success {
  color: var(--success);
}

.kpi-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 2px;
}

.kpi-detail {
  font-size: 9px;
  color: var(--text-light);
  opacity: 0.7;
}

.kpi-summary {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.kpi-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.kpi-summary-row:last-child {
  border-bottom: none;
}

.kpi-summary-row span {
  color: var(--text-light);
}

.kpi-summary-row strong {
  color: var(--text);
}

.kpi-summary-row strong.primary {
  color: var(--primary);
}

/* Analytics Table */
.analytics-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.analytics-table th {
  background: var(--bg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--text-light);
  padding: 10px 8px;
  text-align: center;
  border-bottom: 2px solid var(--border);
}

.analytics-table th:first-child {
  text-align: left;
}

.analytics-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.analytics-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.analytics-table tbody tr:hover {
  background: var(--bg);
}

.analytics-table .total-row {
  background: var(--bg);
  font-weight: 600;
}

.analytics-table .total-row td {
  border-top: 2px solid var(--border);
}

.analytics-table .success {
  color: var(--success);
}

.analytics-table .danger {
  color: var(--danger);
}

.analytics-table .warning {
  color: var(--warning);
}

.analytics-table .primary {
  color: var(--primary);
  font-weight: 600;
}

.analytics-summary {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.summary-item {
  text-align: center;
  flex: 1;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.summary-item .value {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.summary-item .label {
  font-size: 11px;
  color: var(--text-light);
  display: block;
  margin-top: 4px;
}

.summary-item.highlight {
  background: var(--primary);
  color: white;
}

.summary-item.highlight .label {
  color: rgba(255,255,255,0.8);
}

/* Responsive */
@media (max-width: 1024px) {
  .leads-container {
    grid-template-columns: 1fr;
  }

  .lead-detail {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    z-index: 500;
    transition: right 0.3s;
  }

  .lead-detail.active {
    right: 0;
  }

  .stat-card.wide {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .header {
    flex-wrap: wrap;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .form-group.checkboxes {
    grid-column: span 1;
  }
}

/* Utility */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-light); }

/* Appointment Label Buttons */
.label-buttons {
  display: flex;
  gap: 8px;
}

.appt-label-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  font-weight: 500;
}

.appt-label-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.appt-label-btn:hover {
  background: var(--border);
}

.appt-label-btn.selected:hover {
  background: var(--primary-dark);
}

/* Appointment Label Tag */
.appt-label-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #dbeafe;
  color: #1e40af;
  margin-left: 6px;
}

/* WVL Form */
.wvl-form {
  padding: 20px;
}

.wvl-form .form-group {
  margin-bottom: 15px;
}

.wvl-form .form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-light);
}

.wvl-form input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.wvl-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.wvl-form .form-actions-inline {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}


/* Overdue WVL warning */
.wvl-overdue {
  color: var(--danger) !important;
  font-weight: 600;
}

.wvl-overdue-cell {
  background-color: #fef2f2;
}

.wvl-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* WVL Display in Lead Detail */
.wvl-display {
  margin-top: 10px;
}

.wvl-display-item {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}

.wvl-display-item.wvl-overdue-box {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.wvl-display-item.wvl-soon-box {
  border-left-color: var(--warning);
  background: #fffbeb;
}

.wvl-display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wvl-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.wvl-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* WVL Log */
.wvl-log {
  margin-top: 10px;
}

.wvl-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

.wvl-history-header:hover {
  background: var(--border);
}

.wvl-history-list {
  margin-top: 6px;
}

/* Note Preview */
.note-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-preview-text {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}

.note-view-more {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.note-view-more:hover {
  text-decoration: underline;
}

/* Note Viewer Modal */
.note-viewer-container {
  padding: 20px;
}

.note-viewer-content {
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 15px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}

/* Copy button */
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--text-light);
  border-radius: 4px;
  transition: all 0.15s;
}

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

.copy-btn.copied {
  color: var(--success);
}

.value-with-copy {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  cursor: pointer;
}

.toast.toast-success {
  background: #dcfce7;
  border-left: 4px solid var(--success);
  color: #166534;
}

.toast.toast-error {
  background: #fee2e2;
  border-left: 4px solid var(--danger);
  color: #991b1b;
}

.toast.toast-warning {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
  color: #92400e;
}

.toast.toast-info {
  background: #dbeafe;
  border-left: 4px solid var(--primary);
  color: #1e40af;
}

.toast-icon {
  font-size: 16px;
  font-weight: bold;
}

.toast-message {
  flex: 1;
  font-size: 13px;
}

.toast.hiding {
  animation: slideOut 0.3s ease forwards;
}

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

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

/* Confirmation modal */
.confirm-modal-content {
  text-align: center;
  padding: 30px;
}

.confirm-modal-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.confirm-modal-icon.warning {
  color: var(--warning);
}

.confirm-modal-icon.danger {
  color: var(--danger);
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.confirm-modal-message {
  color: var(--text-light);
  margin-bottom: 25px;
}

.confirm-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Loading spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Inline loading for buttons */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Days since last contact column */
.days-cold {
  color: var(--danger);
  font-weight: 600;
}

.days-warm {
  color: var(--warning);
}

.days-recent {
  color: var(--success);
}

/* Detail field full width helper */
.detail-field.full-width {
  grid-column: span 2;
}

/* ============================================
   IMPORT WIZARD STYLES
   ============================================ */

.modal-large {
  max-width: 900px;
  max-height: 90vh;
}

/* Wizard Steps Indicator */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.wizard-step.active,
.wizard-step.completed {
  opacity: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.wizard-step.active .step-number {
  background: var(--primary);
  color: white;
}

.wizard-step.completed .step-number {
  background: var(--success);
  color: white;
}

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

.wizard-step.active .step-label {
  color: var(--primary);
  font-weight: 500;
}

/* Wizard Content */
.wizard-content {
  padding: 20px;
  min-height: 400px;
  max-height: 60vh;
  overflow-y: auto;
}

.wizard-step-content {
  display: none;
}

.wizard-step-content.active {
  display: block;
}

/* File Upload Area */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.file-upload-area p {
  margin: 8px 0;
}

.file-info {
  margin-top: 15px;
  color: var(--success);
  font-weight: 500;
}

/* Column Mapping */
.mapping-instructions {
  margin-bottom: 20px;
  color: var(--text-light);
}

.mapping-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.mapping-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.mapping-row.required {
  border-left: 3px solid var(--warning);
}

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

.mapping-row label .required-mark {
  color: var(--danger);
}

.mapping-select-group {
  display: flex;
  gap: 8px;
}

.mapping-select-group select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.mapping-select-group input.fixed-value {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.mapping-select-group input.fixed-value:disabled {
  background: var(--bg);
  color: var(--text-light);
}

/* Preview Table */
.preview-table {
  max-height: 300px;
  overflow: auto;
  margin: 15px 0;
}

.preview-table table {
  font-size: 12px;
}

.preview-table th {
  white-space: nowrap;
}

.preview-table .error-row {
  background: #fef2f2;
}

.preview-table .warning-row {
  background: #fefce8;
}

.preview-table .error-cell {
  color: var(--danger);
}

/* Duplicates Section */
#duplicatesSection {
  margin-bottom: 20px;
  padding: 15px;
  background: #fef3c7;
  border-radius: var(--radius);
  border: 1px solid #f59e0b;
  max-height: 500px;
  overflow-y: auto;
}

#duplicatesSection h4 {
  margin-bottom: 10px;
}

.duplicate-item {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.duplicate-item.decision-skip {
  border-color: #9ca3af;
  background: #f9fafb;
}

.duplicate-item.decision-merge {
  border-color: var(--success);
  background: #f0fdf4;
}

.duplicate-item.decision-both {
  border-color: var(--primary);
  background: #eff6ff;
}

.duplicate-item.decision-replace {
  border-color: #f97316;
  background: #fff7ed;
}

/* Side-by-side comparison */
.duplicate-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.duplicate-col {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}

.duplicate-col-new {
  border-left: 3px solid var(--primary);
}

.duplicate-col-existing {
  border-left: 3px solid var(--success);
}

.duplicate-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.duplicate-col-title {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
}

.duplicate-col-id {
  font-size: 11px;
  background: var(--text-light);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}

.duplicate-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.duplicate-field:last-child {
  border-bottom: none;
}

.duplicate-field .field-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  min-width: 60px;
}

.duplicate-field .field-value {
  font-size: 13px;
  text-align: right;
  word-break: break-word;
  max-width: 70%;
}

.duplicate-field .field-value.match-highlight {
  background: #fef08a;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.duplicate-field .labels-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.duplicate-field .label-tag {
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}

.duplicate-field .source-tag {
  font-size: 10px;
  background: #6b7280;
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
}

.duplicate-field .tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

/* Stage badges */
.stage-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.stage-new { background: #e5e7eb; color: #374151; }
.stage-not-responsive { background: #fef3c7; color: #92400e; }
.stage-contacted { background: #dbeafe; color: #1e40af; }
.stage-ttv { background: #e0e7ff; color: #3730a3; }
.stage-gb { background: #fce7f3; color: #9d174d; }
.stage-ft { background: #f3e8ff; color: #6b21a8; }
.stage-at { background: #fed7aa; color: #c2410c; }
.stage-concept { background: #cffafe; color: #0e7490; }
.stage-client { background: #dcfce7; color: #166534; }
.stage-lost { background: #fee2e2; color: #991b1b; }

/* Match info */
.duplicate-match-info {
  text-align: center;
  margin-bottom: 12px;
}

.match-type-badge {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 12px;
}

.match-type-badge strong {
  color: var(--warning);
}

/* Multiple match selector */
.duplicate-match-selector {
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.duplicate-match-selector label {
  font-size: 12px;
  color: var(--text-light);
}

.duplicate-match-selector select {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

/* Actions */
.duplicate-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.duplicate-actions .btn {
  min-width: 100px;
  font-size: 12px;
}

.duplicate-actions .btn.active {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}

.duplicate-actions .btn-outline {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.duplicate-actions .btn-outline:hover {
  background: var(--bg);
}

/* Active button states */
.duplicate-actions .btn-active-skip {
  background: #9ca3af;
  border-color: #9ca3af;
  color: white;
}

.duplicate-actions .btn-active-merge {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.duplicate-actions .btn-active-both {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.duplicate-actions .btn-active-replace {
  background: #f97316;
  border-color: #f97316;
  color: white;
}

/* Tiny button for timeline */
.btn-tiny {
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1;
}

.btn-tiny .timeline-icon {
  font-size: 12px;
}

/* Summary stat colors */
.summary-stat .value.info {
  color: var(--primary);
}

.summary-stat .value.replace {
  color: #f97316;
}

/* Confirmation Summary */
.confirmation-summary {
  text-align: center;
  padding: 40px;
}

.confirmation-summary h4 {
  margin-bottom: 20px;
}

.summary-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 30px 0;
}

.summary-stat {
  text-align: center;
}

.summary-stat .value {
  font-size: 36px;
  font-weight: 700;
  display: block;
}

.summary-stat .value.success {
  color: var(--success);
}

.summary-stat .value.warning {
  color: var(--warning);
}

.summary-stat .value.danger {
  color: var(--danger);
}

.summary-stat .label {
  font-size: 13px;
  color: var(--text-light);
}

.import-warning {
  margin-top: 20px;
  padding: 12px;
  background: #dbeafe;
  border-radius: var(--radius);
  font-size: 13px;
}

#validationSummary {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 10px;
}

#validationSummary .error-count {
  color: var(--danger);
  font-weight: 600;
}

/* Wizard Navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.nav-spacer {
  flex: 1;
}

/* ============================================
   SETTINGS MODAL STYLES
   ============================================ */

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--secondary);
}

.settings-container {
  padding: 20px;
}

.settings-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.settings-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.settings-tab:hover {
  color: var(--text);
}

.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.settings-content {
  display: none;
}

.settings-content.active {
  display: block;
}

.settings-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.settings-hint {
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 15px;
}

.settings-columns-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-visible-columns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-column-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.settings-column-item.draggable {
  cursor: grab;
}

.settings-column-item.draggable:active {
  cursor: grabbing;
}

.settings-column-item.dragging {
  opacity: 0.5;
  background: var(--bg);
}

.settings-column-item.drag-over {
  border-color: var(--primary);
  background: #e0edff;
}

.settings-column-item .drag-handle {
  color: var(--text-light);
  font-size: 14px;
  cursor: grab;
}

.settings-column-item .column-label {
  flex: 1;
  font-weight: 500;
}

.settings-column-item .remove-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
}

.settings-column-item .remove-btn:hover {
  color: var(--danger);
}

.settings-add-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-add-columns .btn {
  font-size: 12px;
  padding: 4px 10px;
}

.settings-section {
  margin-bottom: 30px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-list-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
}

.settings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  min-height: 40px;
}

.settings-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.settings-list-item .remove-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

.settings-list-item .remove-btn:hover {
  color: var(--danger);
}

.settings-add-row {
  display: flex;
  gap: 10px;
}

.settings-add-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.settings-add-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

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

/* ============================================
   NOTE EDITOR MODAL STYLES
   ============================================ */

.btn-expand {
  font-size: 11px;
  padding: 2px 8px;
  margin-left: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}

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

.note-editor-container {
  padding: 20px;
}

.note-editor-container textarea {
  width: 100%;
  min-height: 400px;
  padding: 15px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  font-family: inherit;
}

.note-editor-container textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.note-editor-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .mapping-container {
    grid-template-columns: 1fr;
  }

  .wizard-steps {
    padding: 15px 20px;
  }

  .step-label {
    display: none;
  }

  .summary-stats {
    flex-direction: column;
    gap: 20px;
  }
}

/* ============================================
   ACTIVITY TIMELINE MODAL STYLES
   ============================================ */

.modal-xl {
  max-width: 800px;
  max-height: 90vh;
}

.timeline-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 15px;
}

.timeline-header-controls select {
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}

.timeline-header-controls select:focus {
  outline: none;
  border-color: var(--primary);
}

.timeline-container {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-card {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border-left: 4px solid var(--border);
}

.timeline-card[data-type="call"] {
  border-left-color: var(--success);
}

.timeline-card[data-type="appointment"] {
  border-left-color: var(--primary);
}

.timeline-card[data-type="concept"] {
  border-left-color: var(--warning);
}

.timeline-card[data-type="wvl"] {
  border-left-color: #8b5cf6;
}

.timeline-card[data-type="lead_note"] {
  border-left-color: var(--text-light);
}

.timeline-card[data-type="motivation"] {
  border-left-color: #f59e0b;
}

/* Timeline card color overrides based on outcome/status */
.timeline-card.border-success { border-left-color: var(--success) !important; }
.timeline-card.border-danger { border-left-color: var(--danger) !important; }
.timeline-card.border-warning { border-left-color: var(--warning) !important; }
.timeline-card.border-neutral { border-left-color: var(--text-light) !important; }

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

.timeline-icon {
  font-size: 18px;
}

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

.timeline-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.timeline-card-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.timeline-card-content.timeline-no-content {
  color: var(--text-light);
  font-style: italic;
  font-size: 13px;
}

.timeline-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}

.btn-timeline {
  padding: 4px 10px;
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

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

@media (max-width: 768px) {
  .modal-xl {
    max-width: 95%;
  }

  .timeline-header-controls {
    margin-left: 0;
    margin-right: 10px;
  }

  .timeline-container {
    padding: 15px;
  }
}

/* ============ SHARED LOG ENTRY STYLES ============ */
/* Unified styles for Follow-ups, Calls, Appointments, Concepts */

.log-entry {
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}

.log-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.log-entry-time {
  color: var(--text-light);
  font-size: 11px;
}

.log-entry-status {
  font-weight: 500;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg);
}

.log-entry-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.log-entry-content {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.log-entry-scheduled {
  margin-top: 4px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* Status badge colors - unified across all sections */
.status-success { background: #dcfce7; color: #166534; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-neutral { background: #f3f4f6; color: #6b7280; }
.status-info { background: #dbeafe; color: #1d4ed8; }

/* Border colors for status */
.log-entry.border-success { border-left-color: var(--success); }
.log-entry.border-danger { border-left-color: var(--danger); }
.log-entry.border-warning { border-left-color: var(--warning); }
.log-entry.border-neutral { border-left-color: var(--text-light); }
.log-entry.border-info { border-left-color: #8b5cf6; }

/* Overdue styling */
.log-entry.border-overdue {
  border-left-color: var(--danger);
  background: #fef2f2;
}
.log-entry.border-overdue .log-entry-time {
  color: var(--danger);
  font-weight: 500;
}

/* Soon styling (within 7 days) */
.log-entry.border-soon {
  border-left-color: var(--warning);
  background: #fffbeb;
}

/* Completed/history items */
.log-entry.log-entry-completed {
  opacity: 0.7;
  border-left-color: var(--text-light);
  background: var(--bg);
}

/* Product and company tags for concepts */
.log-entry .product {
  font-weight: 600;
  color: var(--text);
}

.log-entry .company {
  color: var(--text-light);
  font-size: 11px;
}

/* Label tag (for appointments) */
.log-entry .appt-label-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 500;
}

/* ============ ADVANCED OPTIONS TOGGLE ============ */
.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  margin-top: 12px;
  padding: 4px 0;
  user-select: none;
}
.advanced-toggle:hover {
  color: var(--text);
}
.advanced-toggle .toggle-icon {
  font-size: 8px;
  transition: transform 0.2s;
}
.advanced-toggle.expanded .toggle-icon {
  transform: rotate(90deg);
}
.advanced-section {
  display: none;
  margin-top: 8px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 12px;
}
.advanced-section.visible {
  display: block;
}
.advanced-section .form-group {
  margin-bottom: 0;
}
.advanced-section label {
  font-size: 11px;
  color: var(--text-light);
}
