:root {
  /* Dark mode by default - Apple-inspired dark palette */
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --panel: #1e293b;
  --card: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --border: #334155;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Light mode theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #475569;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { 
  box-sizing: border-box; 
}

body { 
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  background: var(--bg); 
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h2, h3 { 
  margin: 16px 0; 
}

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 16px; 
}

.row { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
}

.field { 
  flex: 1; 
  min-width: 200px; 
  display: flex; 
  flex-direction: column; 
}

label { 
  font-weight: 600; 
  margin-bottom: 6px; 
  color: var(--muted); 
}

input[type="text"], 
input[type="number"], 
input[type="date"], 
select, 
textarea {
  background: var(--panel); 
  color: var(--text); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 10px 12px;
  font-size: 14px;
}

input:focus, 
select:focus, 
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

textarea { 
  resize: vertical; 
}

.actions { 
  margin-top: 12px; 
}

button {
  background: var(--accent); 
  color: white; 
  border: 0; 
  padding: 10px 16px; 
  border-radius: 8px; 
  cursor: pointer; 
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.2s;
}

button:hover:not(:disabled) {
  background: #4338ca;
}

button.small { 
  padding: 6px 8px; 
  font-size: 12px; 
}

button.danger { 
  background: var(--danger); 
}

button.danger:hover:not(:disabled) { 
  background: #dc2626; 
}

button:disabled { 
  opacity: 0.6; 
  cursor: not-allowed; 
}

.error { 
  color: var(--danger); 
  font-size: 14px; 
  min-height: 18px; 
  margin-top: 8px;
  font-weight: 500;
}

.error-banner { 
  background: #fef2f2; 
  color: #dc2626; 
  border: 1px solid #fecaca; 
  padding: 16px 20px; 
  border-radius: var(--radius-md); 
  margin-bottom: 24px;
  font-weight: 500;
}

.filters, 
.overview, 
.table-wrap { 
  background: var(--panel); 
  padding: 12px; 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  margin-bottom: 12px; 
}

.overview { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
  gap: 12px; 
}

.card { 
  background: var(--card); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 12px; 
  text-align: center;
}

.kpi { 
  font-size: 28px; 
  font-weight: 700; 
  margin-bottom: 4px; 
}

.kpi-label { 
  color: var(--muted); 
  font-size: 12px; 
}

table { 
  width: 100%; 
  border-collapse: collapse; 
}

th, td { 
  padding: 8px 10px; 
  border-bottom: 1px solid var(--border); 
  text-align: left;
}

th { 
  color: var(--muted); 
  font-weight: 600; 
}

.badge { 
  padding: 2px 8px; 
  border-radius: 999px; 
  font-size: 12px; 
  border: 1px solid var(--border); 
  background: #0b1220; 
}

.status-new { 
  color: #fde68a; 
  border-color: #fde68a; 
}

.status-accepted { 
  color: #93c5fd; 
  border-color: #93c5fd; 
}

.status-completed { 
  color: #86efac; 
  border-color: #86efac; 
}

.status-cancelled { 
  color: #fca5a5; 
  border-color: #fca5a5; 
}

/* Loading Spinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  text-align: center;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg);
  z-index: 999;
  box-sizing: border-box;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 8px;
  font-weight: 500;
}

/* Toast */
#toast {
  position: fixed; 
  left: 50%; 
  transform: translateX(-50%); 
  bottom: 24px;
  background: var(--text); 
  color: var(--panel); 
  padding: 16px 24px; 
  border-radius: var(--radius-md); 
  border: 1px solid var(--border);
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
}

#toast.show { 
  opacity: 1; 
  bottom: 32px; 
}

/* Charts */
.chart { 
  width: 100%; 
  min-height: 280px; 
}

/* Professional Dashboard Styles */
.dashboard-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin: 0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.header-content h1 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
}

.dashboard-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-section {
  margin-bottom: 40px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.kpi-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filters-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.apply-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.apply-btn:hover {
  background: #3730a3;
}

.button-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 6px;
}

.leads-section h3 {
  margin-bottom: 16px;
  color: var(--text);
}

.table-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.leads-table th {
  background: var(--card);
  color: var(--muted);
  padding: 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  user-select: none;
  resize: horizontal;
  overflow: hidden;
}

.leads-table th:hover {
  background: var(--border);
  color: var(--text);
}

.leads-table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 8px;
  opacity: 0.5;
  font-size: 10px;
}

.leads-table th.sorted-asc::after {
  content: '↑';
  opacity: 1;
}

.leads-table th.sorted-desc::after {
  content: '↓';
  opacity: 1;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
}

.column-resizer:hover {
  background: var(--accent);
}

.leads-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}

.leads-table tbody tr:hover {
  background: var(--card);
}

.leads-table tbody tr[data-lead-id] {
  cursor: pointer;
  transition: background-color 0.2s;
}

.leads-table tbody tr[data-lead-id]:hover {
  background: var(--border);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-new { background: #fbbf24; color: #92400e; }
.status-accepted { background: #34d399; color: #065f46; }
.status-completed { background: #60a5fa; color: #1e40af; }
.status-cancelled { background: #f87171; color: #991b1b; }

.action-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  margin: 0 2px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.accept { border-color: #10b981; color: #10b981; }
.action-btn.complete { border-color: #3b82f6; color: #3b82f6; }
.action-btn.cancel { border-color: #ef4444; color: #ef4444; }

.actions-cell {
  padding: 8px !important;
}

.action-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 50px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.action-btn.accept { 
  border-color: #10b981; 
  color: #10b981; 
}

.action-btn.complete { 
  border-color: #3b82f6; 
  color: #3b82f6; 
}

.action-btn.cancel { 
  border-color: #ef4444; 
  color: #ef4444; 
}

.action-btn.accept:hover { 
  background: #10b981; 
  color: white; 
}

.action-btn.complete:hover { 
  background: #3b82f6; 
  color: white; 
}

.action-btn.cancel:hover { 
  background: #ef4444; 
  color: white; 
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Analytics Masterpiece Styles */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.analytics-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}

.analytics-controls {
  display: flex;
  gap: 24px;
  align-items: center;
}

.date-range-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.date-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  padding: 4px 8px;
}

.date-separator {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.analytics-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.analytics-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.view-toggles {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.view-btn {
  background: transparent;
  border: none;
  padding: 10px 20px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-right: 1px solid var(--border);
}

.view-btn:last-child {
  border-right: none;
}

.view-btn.active {
  background: var(--accent);
  color: white;
}

.view-btn:hover:not(.active) {
  background: var(--border);
  color: var(--text);
}

/* Executive Summary */
.executive-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.summary-card.revenue::before { background: #10b981; }
.summary-card.conversion::before { background: #3b82f6; }
.summary-card.avgdeal::before { background: #f59e0b; }
.summary-card.velocity::before { background: #8b5cf6; }

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-icon {
  font-size: 32px;
  opacity: 0.8;
}

.summary-content {
  flex: 1;
}

.summary-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.summary-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.summary-change {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 12px;
  background: var(--success);
  color: white;
}

/* Analytics Grids */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.chart-card:hover {
  transform: translateY(-2px);
}

.chart-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg-secondary) 100%);
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chart-header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.metric-highlight {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
}

.chart-controls {
  display: flex;
  gap: 12px;
}

.chart-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text);
  font-size: 12px;
}

.chart-container {
  min-height: 300px;
}

.chart-container.large {
  min-height: 400px;
}

.chart-container.xl {
  min-height: 500px;
}

/* Performance View */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.performance-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.performance-card h4 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.metric-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* Trends View */
.trends-grid {
  display: grid;
  gap: 24px;
}

.trend-indicators {
  display: flex;
  gap: 12px;
}

.trend-indicator {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.trend-indicator.positive {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.trend-indicator.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Call Center Optimized Styles - Apple Design Language */
.intake-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  background: var(--bg);
  min-height: 100vh;
}

.intake-header {
  background: var(--panel);
  padding: 20px 24px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.intake-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.company-subtitle {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.quick-form {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.form-section.compact {
  padding: 14px;
}

.section-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
}

.section-title.compact {
  font-size: 14px;
  margin-bottom: 10px;
  padding-bottom: 4px;
}

.quick-field {
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-group {
  margin-bottom: 16px;
}

.field-group .quick-field {
  margin-bottom: 10px;
}

.field-group .quick-field:last-child {
  margin-bottom: 0;
}

.address-row {
  display: grid;
  grid-template-columns: 2fr 1fr 100px;
  gap: 8px;
}

.quick-field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.005em;
}

.quick-field input,
.quick-field select,
.quick-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.quick-field input:focus,
.quick-field select:focus,
.quick-field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-md);
  transform: translateY(-1px);
}

.quick-field input:hover,
.quick-field select:hover,
.quick-field textarea:hover {
  border-color: var(--muted);
}

.address-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 100px;
  gap: 16px;
}

.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 12px;
  align-items: end;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.sqft-field {
  margin-top: 12px;
}

.area-converter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.area-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.area-toggle button {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.area-toggle button.active {
  background: var(--accent);
  color: white;
}

.area-toggle button:hover:not(.active) {
  background: var(--border);
  color: var(--text);
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--card);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Lead Detail Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--panel);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge-modal {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge-modal.new {
  background: #fbbf24;
  color: #92400e;
}

.status-badge-modal.accepted {
  background: #34d399;
  color: #065f46;
}

.status-badge-modal.completed {
  background: #60a5fa;
  color: #1e40af;
}

.status-badge-modal.cancelled {
  background: #f87171;
  color: #991b1b;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.modal-section h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.modal-field {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-field:last-child {
  margin-bottom: 0;
}

.modal-field label {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-field span {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.sqft-highlight {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}

.modal-actions {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.modal-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-id-debug {
  font-size: 10px;
  color: var(--muted);
  opacity: 0.6;
  font-family: monospace;
}

.status-update {
  display: flex;
  align-items: center;
  gap: 12px;
}

.address-field {
  margin-bottom: 16px !important;
}

.address-field span {
  display: block;
  line-height: 1.6;
  font-weight: 500;
}

.sqft-field-modal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0 !important;
}

.sqft-field-modal .sqft-highlight {
  align-self: flex-start;
  margin-top: 4px;
}

.lead-summary {
  text-align: right;
}

.lead-product {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.lead-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-update label {
  font-weight: 500;
  color: var(--text);
}

.status-update select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-sections {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .modal-header {
    padding: 16px;
  }
  
  .modal-body {
    padding: 16px;
  }
}

.submit-section {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 20px;
  border: 1px solid var(--border);
}

.submit-btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  letter-spacing: -0.005em;
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.submit-btn:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.field-shortcut {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 400;
}

@media (max-width: 768px) {
  .intake-container {
    padding: 12px;
  }
  
  .intake-header {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .intake-header h2 {
    font-size: 20px;
  }
  
  .company-subtitle {
    font-size: 12px;
  }
  
  .quick-form {
    padding: 16px;
  }
  
  .field-row {
    grid-template-columns: 1fr;
  }
  
  .product-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  
  .submit-section {
    padding: 16px;
  }
  
  .submit-btn {
    min-width: 160px;
    padding: 12px 24px;
  }
}

@media (max-width: 600px) {
  .row { 
    flex-direction: column; 
  }
  
  .field { 
    min-width: 100%; 
  }
  
  .overview { 
    grid-template-columns: 1fr 1fr; 
  }
  
  .table-wrap { 
    overflow-x: auto; 
  }
}
