/* LeadFlow Pro - Professional Corporate Design */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary: #64748b;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;

  --bg: #f8fafc;
  --bg-white: #ffffff;
  --bg-alt: #f1f5f9;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --radius: 8px;
  --radius-lg: 12px;

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 72px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(30, 64, 175, 0.08);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 280px;
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.user-menu:hover {
  background: var(--bg-alt);
}

.user-menu img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.user-menu span {
  font-size: 14px;
  font-weight: 500;
}

/* Main Content */
.main {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

.date-filter {
  display: flex;
  gap: 4px;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius);
}

.date-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.date-btn:hover {
  color: var(--text);
}

.date-btn.active {
  background: var(--bg-white);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-icon.blue {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.stat-icon.green {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.stat-icon.orange {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.stat-icon.purple {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple);
}

.stat-content {
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-trend {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.stat-trend.up {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.stat-trend.down {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

/* AI Insights */
.ai-insights {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(124, 58, 237, 0.05));
  border: 1px solid rgba(30, 64, 175, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
}

.ai-content {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.ai-content strong {
  color: var(--text);
}

.ai-actions {
  display: flex;
  gap: 12px;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.link {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* Lead List */
.lead-list {
  max-height: 400px;
  overflow-y: auto;
}

.lead-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.lead-item:hover {
  background: var(--bg-alt);
}

.lead-item:last-child {
  border-bottom: none;
}

.lead-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.lead-info {
  flex: 1;
  min-width: 0;
}

.lead-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-info p {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-badge {
  display: inline-flex;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 4px;
}

.badge-hot {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.badge-warm {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.badge-new {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.badge-contacted {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.lead-score {
  text-align: right;
}

.lead-score .score {
  font-size: 16px;
  font-weight: 700;
}

.lead-score .label {
  font-size: 11px;
  color: var(--text-muted);
}

.score-high { color: var(--success); }
.score-medium { color: var(--warning); }
.score-low { color: var(--text-muted); }

.lead-actions {
  display: flex;
  gap: 8px;
}

.lead-action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lead-action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.lead-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Task List */
.task-list {
  max-height: 400px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.task-item:last-child {
  border-bottom: none;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

.task-checkbox:hover {
  border-color: var(--primary);
}

.task-checkbox.completed {
  background: var(--success);
  border-color: var(--success);
}

.task-content {
  flex: 1;
}

.task-content h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.task-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-type {
  font-size: 16px;
}

/* Activity List */
.activity-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 16px 24px;
}

.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-icon.call {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.activity-icon.email {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.activity-icon.sms {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple);
}

.activity-icon.ai {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.activity-content {
  flex: 1;
}

.activity-content h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.activity-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Source Chart */
.source-chart {
  padding: 24px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.source-item:last-child {
  margin-bottom: 0;
}

.source-label {
  width: 100px;
  font-size: 13px;
  color: var(--text-secondary);
}

.source-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.source-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.source-value {
  width: 40px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-alt);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.select-sm {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  cursor: pointer;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.2s ease;
}

.modal-sm {
  max-width: 440px;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast-icon.success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.toast-icon.error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.toast-icon.info {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.toast-content {
  flex: 1;
}

.toast-content strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.toast-close:hover {
  color: var(--text);
}

/* Empty States */
.empty-state {
  padding: 48px 24px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Responsive */




/* Additional Component Styles */

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
}

.badge-success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.badge-secondary {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

.badge-primary {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

/* Lead Name & Meta */
.lead-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.lead-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.lead-source {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-source svg {
  width: 14px;
  height: 14px;
}

.lead-time {
  color: var(--text-muted);
}

.lead-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* Task Item Updates */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.task-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin-top: 2px;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.task-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-icon.danger:hover {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Activity Icon Colors */
.activity-icon.green {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.activity-icon.blue {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.activity-icon.purple {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple);
}

.activity-icon.orange {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.activity-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}

.activity-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}

/* Source Info */
.source-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.source-name {
  font-size: 14px;
  font-weight: 500;
}

.source-count {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toast Updates */
.toast {
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success svg {
  color: var(--success);
}

.toast-error svg {
  color: var(--danger);
}

.toast-info svg {
  color: var(--primary);
}

/* Quick Action Content */
.quick-action-content {
  text-align: center;
}

.quick-action-content p {
  margin-bottom: 16px;
}

.phone-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0;
}

.call-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #047857;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #b45309;
}

/* Leads Table */
.leads-table-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table th,
.leads-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.leads-table th {
  background: var(--bg-alt);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.leads-table tbody tr:hover {
  background: var(--bg-alt);
}

.leads-table tbody tr.selected {
  background: rgba(30, 64, 175, 0.05);
}

.lead-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-cell img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.lead-cell strong {
  font-size: 14px;
  display: block;
}

.lead-cell small {
  font-size: 12px;
  color: var(--text-secondary);
}

.contact-cell a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}

.contact-cell span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.source-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.score-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.score-badge.high {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.score-badge.medium {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.score-badge.low {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  gap: 4px;
}

/* Table Footer */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

#pageInfo {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Filters Bar */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  color: var(--text-secondary);
}

.filter-group select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  cursor: pointer;
}

/* Lead Detail Modal */
.modal-lg {
  max-width: 800px;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.detail-value {
  font-weight: 500;
  font-size: 14px;
}

.detail-value a {
  color: var(--primary);
  text-decoration: none;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lead-detail-sidebar {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

.mini-task {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.mini-task .task-type {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-alt);
  border-radius: 4px;
  font-size: 11px;
  text-transform: uppercase;
  margin-right: 8px;
}

.mini-task .task-desc {
  font-size: 13px;
}

.mini-task .task-due {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mini-activity {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.mini-activity .activity-icon {
  width: 32px;
  height: 32px;
}

.mini-activity .activity-desc {
  font-size: 13px;
  display: block;
}

.mini-activity .activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.empty-state-sm {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Import Area */
.import-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.import-area:hover {
  border-color: var(--primary);
  background: rgba(30, 64, 175, 0.02);
}

.import-area svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.import-area p {
  font-size: 14px;
  color: var(--text-secondary);
}

.import-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-template {
  margin-top: 16px;
  text-align: center;
}

.import-template a {
  color: var(--primary);
}

/* Sequences Grid */
.sequences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
}

.sequence-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.sequence-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.sequence-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sequence-title h3 {
  font-size: 16px;
  font-weight: 600;
}

.sequence-actions {
  display: flex;
  gap: 4px;
}

.sequence-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.sequence-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.sequence-stats-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-mini {
  text-align: center;
}

.stat-mini-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.stat-mini-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sequence-footer {
  display: flex;
  gap: 12px;
}

/* Steps Builder */
.steps-builder {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.steps-builder h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.step-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.step-number {
  font-size: 13px;
  font-weight: 600;
}

.step-body {
  padding: 16px;
}

.step-body .form-group {
  margin-bottom: 12px;
}

.step-body .form-group:last-child {
  margin-bottom: 0;
}

/* Sequence Detail View */
.sequence-detail {
  max-height: 70vh;
  overflow-y: auto;
}

.detail-meta {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.perf-item {
  text-align: center;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}

.perf-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.perf-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.steps-timeline {
  position: relative;
  padding-left: 40px;
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  margin-left: -1px;
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -17px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.timeline-marker.email {
  background: var(--primary);
}

.timeline-marker.sms {
  background: var(--purple);
}

.timeline-marker.task {
  background: var(--warning);
}

.timeline-content {
  padding: 4px 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.step-type-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.step-type-badge.email {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.step-type-badge.sms {
  background: rgba(124, 58, 237, 0.1);
  color: var(--purple);
}

.step-type-badge.task {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.step-delay {
  font-size: 12px;
  color: var(--text-muted);
}

.step-subject {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.step-preview {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Lead Selector */
.lead-selector {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lead-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.lead-checkbox:hover {
  background: var(--bg-alt);
}

.lead-checkbox:last-child {
  border-bottom: none;
}

.lead-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.lead-checkbox-info strong {
  display: block;
  font-size: 14px;
}

.lead-checkbox-info span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Empty State Full */
.empty-state-full {
  grid-column: 1 / -1;
  padding: 80px 40px;
  text-align: center;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-state-full svg {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.empty-state-full h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state-full p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Analytics Charts */
.chart-container {
  padding: 24px;
  min-height: 300px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bar-wrapper {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(to top, var(--primary), var(--primary-light));
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.5s ease;
}

.bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
}

.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.donut-chart {
  display: flex;
  align-items: center;
  gap: 40px;
}

.donut-chart svg {
  width: 180px;
  height: 180px;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-total {
  display: block;
  font-size: 32px;
  font-weight: 700;
}

.donut-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.chart-legend {
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.legend-item:last-child {
  border-bottom: none;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-label {
  flex: 1;
  font-size: 14px;
}

.legend-value {
  font-size: 13px;
  color: var(--text-secondary);
}

.horizontal-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.h-bar-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.h-bar-label {
  width: 80px;
  font-size: 14px;
  color: var(--text-secondary);
}

.h-bar-wrapper {
  flex: 1;
  height: 32px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.h-bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 0.5s ease;
  min-width: 40px;
}

.h-bar-value {
  color: white;
  font-size: 13px;
  font-weight: 600;
}

/* Analytics Table */
.table-container {
  padding: 0 24px 24px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.analytics-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* Top Leads */
.top-leads-list {
  padding: 24px;
}

.top-lead-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.top-lead-item:last-child {
  border-bottom: none;
}

.rank {
  width: 32px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.top-lead-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.top-lead-item .lead-info {
  flex: 1;
}

.top-lead-item .lead-info strong {
  display: block;
  font-size: 14px;
}

.top-lead-item .lead-info span {
  font-size: 12px;
  color: var(--text-secondary);
}

.score-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.score-circle.high {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.score-circle.medium {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.score-circle.low {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

/* Activity Summary */
.activity-summary {
  padding: 24px;
}

.activity-summary-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-summary-item:last-child {
  border-bottom: none;
}

.activity-details {
  flex: 1;
}

.activity-details .activity-desc {
  font-size: 14px;
}

.activity-details .activity-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Weekly Grid */
.weekly-grid {
  padding: 24px;
}

.weekly-header {
  display: grid;
  grid-template-columns: 180px repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
}

.weekly-header span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
}

.weekly-header span:first-child {
  text-align: left;
}

.weekly-row {
  display: grid;
  grid-template-columns: 180px repeat(3, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.week-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.week-value {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

/* Settings Layout */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.settings-nav-link svg {
  width: 20px;
  height: 20px;
}

.settings-nav-link:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.settings-nav-link.active {
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary);
}

.settings-content {
  min-height: 600px;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section .card {
  margin-bottom: 24px;
}

.settings-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-actions {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* Settings List */
.settings-list {
  padding: 8px 24px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.setting-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 26px;
  transition: all 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Template List */
.template-list {
  padding: 8px 24px;
}

.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.template-item:last-child {
  border-bottom: none;
}

.template-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.template-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

.template-actions {
  display: flex;
  gap: 8px;
}

/* Integrations */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px;
}

.integration-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.integration-card.connected {
  background: rgba(5, 150, 105, 0.05);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.integration-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.integration-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.integration-info {
  flex: 1;
}

.integration-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.integration-status {
  font-size: 12px;
  color: var(--text-muted);
}

.integration-status.connected {
  color: var(--success);
}

/* Team List */
.team-list {
  padding: 8px 24px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.team-member:last-child {
  border-bottom: none;
}

.team-member img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.member-info {
  flex: 1;
}

.member-info strong {
  display: block;
  font-size: 14px;
}

.member-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

.member-role {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.member-role.admin {
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
}

.member-role.agent {
  background: var(--bg-alt);
  color: var(--text-secondary);
}

/* Data Actions */
.data-actions {
  padding: 8px 24px;
}

.data-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
}

.data-action:last-child {
  border-bottom: none;
}

.data-action.danger {
  padding-top: 24px;
  margin-top: 8px;
  border-top: 2px solid var(--danger);
}

.data-action-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.data-action-info span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Storage Info */
.storage-info {
  padding: 24px;
}

.storage-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}

.storage-stats {
  display: flex;
  gap: 32px;
}

.storage-stats span {
  font-size: 13px;
  color: var(--text-secondary);
}

.storage-stats strong {
  color: var(--text);
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 12px;
}

/* Empty Table */
.empty-table {
  padding: 60px 24px;
  text-align: center;
}

/* Back to Home Button */
.back-home{display:inline-flex;align-items:center;gap:8px;padding:12px 20px;margin:16px;background:#0a0a0a;border-radius:6px;color:#fff;text-decoration:none;transition:all .2s}
.back-home:hover{background:#5ae6a8;color:#0a0a0a}
.back-home svg{width:16px;height:16px;flex-shrink:0}
.back-home .logo-text{font-family:'Cormorant Garamond',Georgia,serif;font-size:18px;font-weight:500;white-space:nowrap}
.back-home em{font-style:normal;color:#5ae6a8}
.back-home:hover em{color:#0a0a0a}

/* Enhanced Mobile Responsiveness */

/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Tablet breakpoint */
@media (max-width: 1200px) {
  .content-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Reset any problematic defaults */
  * { max-width: 100%; }

  /* Back home button */
  .back-home {
    margin: 8px 12px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
  }

  /* Header - complete mobile overhaul */
  .header {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    padding: 12px !important;
    gap: 12px !important;
    position: relative !important;
  }

  .header-left {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .logo {
    justify-content: center !important;
    font-size: 16px !important;
  }

  .logo-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .logo-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Navigation - horizontal scroll */
  .nav, .nav-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding: 4px 0 !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }

  .nav::-webkit-scrollbar,
  .nav-menu::-webkit-scrollbar {
    display: none !important;
  }

  .nav-link, .nav-item, .nav-btn {
    flex-shrink: 0 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  /* Hide header right section on mobile */
  .header-right {
    display: none !important;
  }

  /* Main content */
  .main, .main-content {
    padding: 12px !important;
  }

  /* Page header */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }

  .page-header h1 {
    font-size: 20px !important;
    line-height: 1.2 !important;
  }

  .page-header p {
    font-size: 13px !important;
  }

  .date-display {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }

  /* Stats grid - single column */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .stat-card {
    padding: 14px !important;
    gap: 12px !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
  }

  .stat-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .stat-value {
    font-size: 22px !important;
  }

  .stat-label {
    font-size: 12px !important;
  }

  /* AI Panel */
  .ai-panel {
    padding: 14px !important;
    margin-bottom: 16px !important;
  }

  .ai-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .ai-badge {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }

  .ai-content {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  .ai-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .ai-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Content grid - single column */
  .content-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Cards */
  .card {
    margin-bottom: 12px !important;
  }

  .card-header, .panel-header {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .card-header h2, .panel-header h2 {
    font-size: 14px !important;
  }

  /* Lists */
  .schedule-list, .upcoming-list, .activity-list,
  .carts-list, .campaigns-list, .recoveries-list,
  .contracts-list, .contacts-list, .deals-pipeline,
  .reviews-list {
    max-height: 250px !important;
  }

  .schedule-item, .upcoming-item, .activity-item,
  .cart-item, .campaign-item, .recovery-item,
  .contract-item, .contact-item, .deal-item,
  .review-item {
    padding: 12px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .time-slot {
    min-width: auto !important;
    font-size: 12px !important;
  }

  .patient-info, .item-info, .contact-info, .deal-info {
    min-width: 0 !important;
  }

  .patient-name, .item-title, .contact-name, .deal-name {
    font-size: 13px !important;
  }

  .visit-type, .item-meta, .contact-company, .deal-company {
    font-size: 11px !important;
  }

  .status-badge {
    font-size: 10px !important;
    padding: 3px 8px !important;
  }

  /* Calendar */
  .calendar-container {
    padding: 12px !important;
  }

  .calendar-header {
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .calendar-header h3 {
    font-size: 16px !important;
    order: -1 !important;
  }

  .calendar-grid {
    font-size: 11px !important;
  }

  .calendar-day-header {
    padding: 6px 2px !important;
    font-size: 10px !important;
  }

  .calendar-day {
    min-height: 40px !important;
    padding: 4px !important;
    font-size: 11px !important;
  }

  .day-count {
    font-size: 8px !important;
  }

  .time-slots-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 12px !important;
  }

  .time-slot {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  /* Tables - make them scrollable and card-like */
  .patients-table, .table {
    padding: 0 !important;
    overflow-x: auto !important;
  }

  .table-header {
    display: none !important;
  }

  .table-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 12px !important;
    border-bottom: 1px solid var(--border, #e5e7eb) !important;
  }

  .table-row > span {
    display: block !important;
    width: 100% !important;
    font-size: 13px !important;
  }

  .table-row > span:first-child {
    font-weight: 600 !important;
    font-size: 14px !important;
  }

  /* Providers grid */
  .providers-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .provider-card {
    padding: 16px !important;
  }

  .provider-card img {
    width: 60px !important;
    height: 60px !important;
  }

  .provider-card h3 {
    font-size: 15px !important;
  }

  .provider-stats {
    flex-direction: column !important;
    gap: 8px !important;
    font-size: 13px !important;
  }

  /* Settings */
  .settings-section {
    padding: 14px !important;
  }

  .settings-section h3 {
    font-size: 15px !important;
  }

  .form-group label {
    font-size: 13px !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  .form-control {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .search-bar {
    padding: 12px !important;
  }

  .search-input {
    font-size: 14px !important;
    padding: 10px 12px !important;
  }

  /* Buttons */
  .btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  .btn-sm {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .header-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Modals */
  .modal-overlay {
    padding: 12px !important;
    align-items: flex-start !important;
    padding-top: 60px !important;
  }

  .modal {
    max-width: 100% !important;
    max-height: calc(100vh - 80px) !important;
    margin: 0 !important;
  }

  .modal-header {
    padding: 14px 16px !important;
  }

  .modal-header h2 {
    font-size: 16px !important;
  }

  .modal-body {
    padding: 16px !important;
    max-height: calc(100vh - 200px) !important;
    overflow-y: auto !important;
  }

  .modal-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Toast */
  .toast-container {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
  }

  .toast {
    min-width: auto !important;
    width: 100% !important;
    padding: 12px !important;
  }

  /* Sidebar layouts (for systems with sidebars) */
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    transform: translateX(-100%) !important;
    z-index: 1000 !important;
    transition: transform 0.3s !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  .app-container {
    flex-direction: column !important;
  }

  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Filter bars */
  .filter-bar {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 8px !important;
  }

  .filter-btn {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
  }

  /* Contract/Template grids */
  .contracts-grid,
  .templates-grid {
    grid-template-columns: 1fr !important;
  }

  /* Activity items */
  .activity-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .activity-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .activity-title {
    font-size: 13px !important;
  }

  .activity-meta {
    font-size: 11px !important;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .page-header h1 {
    font-size: 18px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }

  .nav-link, .nav-item, .nav-btn {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }

  .calendar-day {
    min-height: 32px !important;
    font-size: 10px !important;
  }

  .calendar-day-header {
    font-size: 9px !important;
  }

  .day-count {
    display: none !important;
  }
}
