/* Professional CRM Design System */
:root {
  /* Primary Colors - Professional Blue */
  --primary: #0066CC;
  --primary-dark: #0052A3;
  --primary-light: #E6F2FF;
  --primary-hover: #004D99;
  
  /* Secondary Colors */
  --secondary: #6B7280;
  --secondary-light: #F3F4F6;
  
  /* Status Colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  
  /* Neutral Colors */
  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
}

/* Typography System */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-secondary);
  font-weight: 400;
}

/* Professional Typography Hierarchy */
h1, .h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h2, .h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

h3, .h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

h4, .h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

h5, .h5 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

h6, .h6 {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Professional Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 2px;
}

/* Main Content Area */
.main-content {
  margin-left: 224px;
  min-height: 100vh;
  background: var(--bg-secondary);
}

/* Professional Sticky Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

/* Kanban Columns - Professional Design */
.kanban-column {
  background: var(--bg-secondary);
  border-radius: 0 0 6px 6px;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.kanban-column::-webkit-scrollbar {
  width: 6px;
}

.kanban-column::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-column::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 3px;
}

.kanban-card-compact {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: move;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.kanban-card-compact:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.kanban-card-compact.dragging {
  opacity: 0.6;
  transform: rotate(2deg) scale(0.98);
}

.kanban-card-compact.chosen {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Legacy kanban-card */
.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  cursor: move;
  transition: all 0.2s;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.6;
}

/* Phase Colors - Professional Palette */
.phase-lead-identified { 
  border-left: 4px solid #9CA3AF; 
}

.phase-initial-outreach { 
  border-left: 4px solid #F59E0B; 
}

.phase-connected { 
  border-left: 4px solid #3B82F6; 
}

.phase-qualified { 
  border-left: 4px solid #10B981; 
}

.phase-meeting { 
  border-left: 4px solid #8B5CF6; 
}

.phase-proposal { 
  border-left: 4px solid #EC4899; 
}

.phase-negotiation { 
  border-left: 4px solid #F97316; 
}

.phase-won { 
  border-left: 4px solid #10B981; 
}

.phase-lost { 
  border-left: 4px solid #EF4444; 
}

/* Professional Badges */
.badge-high { 
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.badge-medium { 
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.badge-low { 
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Status Badges */
.badge-active { 
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.badge-on-hold { 
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.badge-closed { 
  background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Professional Table Styles */
.table-container {
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

table {
  font-size: 14px;
  font-weight: 400;
}

table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

table td {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

table tr:hover {
  background: var(--bg-secondary);
}

/* Professional Form Styles */
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg);
}

.form-input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Professional Button Styles */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, #4B5563 100%);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Professional Card Styles */
.card {
  background: var(--bg);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.card:hover {
  box-shadow: var(--shadow);
}

/* Professional Tab Styles */
.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

.tab-button {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: var(--text-secondary);
}

.tab-button:hover {
  background-color: var(--bg-secondary);
  color: var(--text);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
  background: var(--bg);
}

/* Professional Loading Spinner */
.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Kanban Board Container */
.kanban-board-container {
  background: var(--bg-secondary);
  min-height: calc(100vh - 120px);
}

/* Card Text Truncation */
.kanban-card-compact h4 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.5em;
  font-weight: 600;
  color: var(--text);
}

/* Professional Labels */
label {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
}

/* Professional Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Professional Select Elements */
select {
  font-weight: 500;
  color: var(--text);
}

/* Professional Text Colors */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Professional Background Colors */
.bg-primary-light { background: var(--primary-light); }
.bg-success-light { background: var(--success-light); }
.bg-danger-light { background: var(--danger-light); }
.bg-warning-light { background: var(--warning-light); }

/* Professional Dividers */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Professional Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .kanban-column {
    width: 280px !important;
  }
  
  h1, .h1 { font-size: 20px; }
  h2, .h2 { font-size: 18px; }
  h3, .h3 { font-size: 16px; }
}

/* Print Styles */
@media print {
  .sidebar,
  .btn,
  .tab-button {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* Quill Editor Styles */
.ql-container {
  font-size: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ql-editor {
  min-height: 300px;
}

.ql-toolbar {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border: 2px solid var(--border);
  border-bottom: none;
}

.ql-container {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  border: 2px solid var(--border);
  border-top: none;
}

.ql-editor.ql-blank::before {
  color: var(--text-tertiary);
  font-style: normal;
}

/* Rich text content display */
.prose {
  color: var(--text);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 10px 0;
}

.prose p {
  margin: 10px 0;
}

.prose h1, .prose h2, .prose h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}

.prose ul, .prose ol {
  margin: 10px 0;
  padding-left: 25px;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
}
