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

/* ============================================================================
   LEADSONLINE CRM - Modern Salesforce-Inspired Design
   ============================================================================ */

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

:root {
  /* LeadsOnline Brand Colors */
  --lo-navy: #003B5C;
  --lo-blue: #00587C;
  --lo-turquoise: #0092BC;
  --lo-teal: #6AD1E3;
  --lo-black: #101820;
  --lo-gray: #A2AAAD;
  --lo-white: #F5F9FF;
  
  /* Accent Colors */
  --lo-mint: #71CC98;
  --lo-lime: #A4D65E;
  --lo-lemon: #FFCD00;
  --lo-orange: #FFA300;
  --lo-grapefruit: #FF808B;
  --lo-lilac: #CAA2DD;

  /* Modern semantic mappings */
  --bg: #f0f4f8;
  --bg-subtle: #e8eef4;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --primary: var(--lo-turquoise);
  --primary-hover: var(--lo-blue);
  --primary-subtle: rgba(0, 146, 188, 0.1);
  --accent: var(--lo-teal);
  --success: #10b981;
  --success-subtle: #d1fae5;
  --warning: #f59e0b;
  --warning-subtle: #fef3c7;
  --danger: #ef4444;
  --danger-subtle: #fee2e2;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition-fast: 0.1s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Spacing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 56px;
}

/* ============================================================================
   DARK MODE
   ============================================================================ */
[data-theme="dark"] {
  --bg: #0c1222;
  --bg-subtle: #111827;
  --surface: #1e293b;
  --surface-hover: #273548;
  --surface-2: #334155;
  --surface-3: #475569;
  --border: #334155;
  --border-subtle: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --primary-subtle: rgba(0, 146, 188, 0.2);
  --success-subtle: rgba(16, 185, 129, 0.2);
  --warning-subtle: rgba(245, 158, 11, 0.2);
  --danger-subtle: rgba(239, 68, 68, 0.2);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  display: flex;
  min-height: 100vh;
}

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

/* ============================================================================
   GLOBAL HEADER / UTILITY BAR
   ============================================================================ */
.global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--lo-navy);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}

.global-header .logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 160px;
}

.global-header .logo .leads { color: var(--lo-teal); }
.global-header .logo .online { color: white; }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  transition: var(--transition);
}

.header-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.header-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--lo-teal);
}

.header-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.header-search .shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-family: monospace;
}

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

.header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: var(--transition);
  font-size: 18px;
  position: relative;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.header-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--lo-grapefruit);
  border-radius: 50%;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.user-menu:hover { background: rgba(255, 255, 255, 0.15); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lo-turquoise), var(--lo-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: white;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

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

.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow);
  z-index: 50;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-footer-content { opacity: 0; width: 0; }

.sidebar-toggle {
  position: absolute;
  top: 12px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
  z-index: 10;
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.nav-section {
  padding: 16px 12px 8px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.nav-links {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-links li { margin: 2px 12px; }

.nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.nav-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-links a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active:hover {
  background: var(--primary-subtle);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-text {
  transition: var(--transition);
  overflow: hidden;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-content {
  transition: var(--transition);
  overflow: hidden;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 24px;
  background: var(--bg);
  min-height: calc(100vh - var(--header-height));
  transition: margin-left var(--transition-slow);
}

.sidebar.collapsed ~ .content {
  margin-left: var(--sidebar-collapsed);
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

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

/* ============================================================================
   CARDS & SURFACES
   ============================================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-subtle); }
.stat-icon.green { background: var(--success-subtle); }
.stat-icon.orange { background: var(--warning-subtle); }
.stat-icon.red { background: var(--danger-subtle); }

.stat-content { flex: 1; }

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

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

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--lo-turquoise), var(--lo-blue));
  color: white;
  box-shadow: 0 2px 4px rgba(0, 146, 188, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--lo-blue), var(--lo-navy));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 146, 188, 0.4);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger);
}

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

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

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

.btn-icon.sm {
  width: 28px;
  height: 28px;
}

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

/* Quick action buttons (legacy support) */
.quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

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

/* ============================================================================
   TABLES
   ============================================================================ */
.data-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .actions {
  text-align: right;
  white-space: nowrap;
}

.table-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.table-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ============================================================================
   PIPELINE / KANBAN
   ============================================================================ */
.pipeline {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  margin: 0 -24px;
  padding: 0 24px 20px;
}

.pipeline-column {
  min-width: 300px;
  max-width: 300px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.pipeline-column.drag-over {
  background: var(--primary-subtle);
}

.pipeline-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid transparent;
}

.pipeline-header.prospecting { border-color: var(--lo-gray); }
.pipeline-header.qualification { border-color: var(--lo-blue); }
.pipeline-header.proposal { border-color: var(--lo-turquoise); }
.pipeline-header.negotiation { border-color: var(--lo-orange); }
.pipeline-header.closed_won { border-color: var(--lo-mint); }
.pipeline-header.closed_lost { border-color: var(--lo-grapefruit); }

.pipeline-header h3 {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.pipeline-header .count {
  padding: 4px 10px;
  background: var(--surface);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.pipeline-total {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 16px 8px;
  font-weight: 600;
}

.pipeline-cards {
  padding: 8px 12px 12px;
  min-height: 200px;
  flex: 1;
  overflow-y: auto;
}

.deal-card {
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.deal-card[draggable="true"] { cursor: grab; }
.deal-card.dragging { opacity: 0.5; cursor: grabbing; }

.deal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.deal-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

.deal-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.deal-company {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.deal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.deal-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================================
   SALES PATH (Salesforce-style Progress)
   ============================================================================ */
.sales-path {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.path-step {
  flex: 1;
  min-width: 120px;
  position: relative;
  padding: 12px 24px 12px 32px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-left: -12px;
}

.path-step:first-child {
  margin-left: 0;
  padding-left: 24px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  border-radius: var(--radius) 0 0 var(--radius);
}

.path-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.path-step:hover {
  background: var(--surface-3);
}

.path-step.completed {
  background: var(--lo-navy);
  color: white;
}

.path-step.current {
  background: var(--primary);
  color: white;
}

.path-step.won {
  background: var(--success);
  color: white;
}

.path-step.lost {
  background: var(--danger);
  color: white;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: var(--transition);
}

.modal.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

.modal.show .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

/* ============================================================================
   DETAIL VIEW
   ============================================================================ */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
}

.detail-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

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

.detail-section {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-section-header {
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.detail-section-body {
  padding: 20px;
}

.detail-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.detail-row .label {
  width: 140px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-row .value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

/* Activity Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: var(--transition);
}

.timeline-item:hover {
  background: var(--surface-3);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
}

.timeline-item .type {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
}

.timeline-item .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================================================
   BADGES & STATUS
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-new { background: var(--primary-subtle); color: var(--primary); }
.badge-contacted { background: var(--warning-subtle); color: var(--warning); }
.badge-qualified { background: var(--success-subtle); color: var(--success); }
.badge-unqualified { background: var(--surface-3); color: var(--text-muted); }
.badge-converted { background: var(--lo-lime); color: var(--lo-black); }

.badge-hot { background: var(--danger-subtle); color: var(--danger); }
.badge-warm { background: var(--warning-subtle); color: var(--warning); }
.badge-cold { background: var(--primary-subtle); color: var(--primary); }

/* Status badges (legacy support) */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-new { background: var(--primary-subtle); color: var(--primary); }
.status-contacted { background: var(--warning-subtle); color: var(--warning); }
.status-qualified { background: var(--success-subtle); color: var(--success); }
.status-unqualified { background: var(--surface-3); color: var(--text-muted); }
.status-converted { background: var(--lo-lime); color: var(--lo-black); }
.status-hot { background: var(--danger-subtle); color: var(--danger); }
.status-warm { background: var(--warning-subtle); color: var(--warning); }
.status-cold { background: var(--primary-subtle); color: var(--primary); }

/* SLA badges */
.sla-warning {
  background: var(--danger-subtle);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.sla-ok {
  background: var(--success-subtle);
  color: var(--success);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stage-prospecting { background: var(--surface-3); color: var(--text-secondary); }
.stage-qualification { background: var(--primary-subtle); color: var(--primary); }
.stage-proposal { background: var(--warning-subtle); color: var(--warning); }
.stage-negotiation { background: #fce7f3; color: #db2777; }
.stage-closed_won { background: var(--success-subtle); color: var(--success); }
.stage-closed_lost { background: var(--danger-subtle); color: var(--danger); }

.forecast-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.forecast-commit { background: var(--success-subtle); color: var(--success); }
.forecast-best_case { background: var(--primary-subtle); color: var(--primary); }
.forecast-pipeline { background: var(--surface-3); color: var(--text-muted); }
.forecast-omit { background: var(--surface-2); color: var(--text-muted); }

.health-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.health-green { background: var(--success-subtle); color: var(--success); }
.health-yellow { background: var(--warning-subtle); color: var(--warning); }
.health-red { background: var(--danger-subtle); color: var(--danger); }

/* ============================================================================
   TODAY / DASHBOARD
   ============================================================================ */
.today-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.today-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

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

.today-section-body {
  padding: 12px;
}

.today-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.today-item:last-child { margin-bottom: 0; }

.today-item:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateX(4px);
}

.today-item .emoji {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
  margin-right: 12px;
}

.today-item .content { flex: 1; }

.today-item .title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.today-item .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.today-item .action {
  opacity: 0;
  transition: var(--transition);
}

.today-item:hover .action { opacity: 1; }

/* AI Suggestions Card */
.ai-suggestion-card {
  background: linear-gradient(135deg, var(--lo-navy) 0%, var(--lo-blue) 100%);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  color: white;
}

.ai-suggestion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.ai-suggestion-content {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.ai-suggestion-action {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition);
}

.ai-suggestion-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ============================================================================
   COMMAND PALETTE
   ============================================================================ */
.cmd-palette {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.cmd-palette.open {
  opacity: 1;
  visibility: visible;
}

.cmd-palette-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 600px;
  max-height: 60vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(-10px);
  transition: var(--transition);
}

.cmd-palette.open .cmd-palette-box {
  transform: scale(1) translateY(0);
}

.cmd-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 15px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  outline: none;
}

.cmd-input::placeholder { color: var(--text-muted); }

.cmd-results {
  max-height: calc(60vh - 60px);
  overflow-y: auto;
}

.cmd-group {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.cmd-group:last-child { border-bottom: none; }

.cmd-group-title {
  padding: 6px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.cmd-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cmd-item:hover,
.cmd-item.selected {
  background: var(--surface-2);
}

.cmd-item .icon {
  width: 32px;
  font-size: 16px;
}

.cmd-item .label { flex: 1; }

.cmd-item .shortcut {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.cmd-item .detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--lo-navy) 0%, var(--lo-blue) 50%, var(--lo-turquoise) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-box {
  background: var(--surface);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.login-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.login-logo span:first-child { color: var(--lo-turquoise); }
.login-logo span:last-child { color: var(--lo-navy); }

.login-tagline {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-error {
  background: var(--danger-subtle);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: none;
  font-size: 13px;
  font-weight: 500;
}

.login-error.show { display: block; }

/* ============================================================================
   REPORTS
   ============================================================================ */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.report-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.report-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.report-card-body {
  padding: 20px;
}

/* Velocity Cards */
.velocity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.velocity-card {
  background: linear-gradient(135deg, var(--lo-navy) 0%, var(--lo-blue) 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.velocity-card .label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.velocity-card .value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 4px;
}

.velocity-card .sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

/* Leaderboard */
.leaderboard-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: var(--transition);
}

.leaderboard-card:hover {
  border-color: var(--primary);
}

.leaderboard-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lo-navy);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  margin-right: 16px;
  flex-shrink: 0;
}

.leaderboard-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.leaderboard-rank.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.leaderboard-rank.bronze { background: linear-gradient(135deg, #fb923c, #ea580c); }

/* ============================================================================
   UTILITIES
   ============================================================================ */
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.clickable:hover { color: var(--primary); }

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-mono { font-family: 'SF Mono', Monaco, monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Keyboard shortcuts */
.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: 'SF Mono', Monaco, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  margin-left: 8px;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* Live Indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 300px;
  margin: 0 auto;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Optimistic UI feedback */
.optimistic {
  opacity: 0.6;
  pointer-events: none;
}

/* Legacy suggestion card (for backward compatibility) */
.suggestion-card {
  background: linear-gradient(135deg, var(--lo-turquoise) 0%, var(--lo-blue) 100%);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.suggestion-card .suggestion-text {
  font-size: 14px;
  line-height: 1.4;
}

.suggestion-card .suggestion-action {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: var(--transition);
}

.suggestion-card .suggestion-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Smart suggestions panel */
.smart-suggestions {
  background: var(--primary-subtle);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}

.smart-suggestions h4 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
}

.suggestion-item:last-child {
  margin-bottom: 0;
}

.suggestion-item .icon {
  margin-right: 10px;
  font-size: 16px;
}

.suggestion-item .action-link {
  margin-left: auto;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.suggestion-item .action-link:hover {
  text-decoration: underline;
}

/* Quick action bar */
.quick-action-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.quick-action-bar button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  color: var(--text);
}

.quick-action-bar button:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

/* Legacy toolbar (maps to page-header) */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 20px;
}

.toolbar h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Editable fields */
.editable {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.editable:hover {
  background: var(--surface-2);
}

.editable.editing {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary);
}

.inline-input {
  width: 100%;
  padding: 4px 8px;
  margin: -4px -8px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
}

/* Notes and activity items */
.note-item,
.activity-item {
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 10px;
  border-left: 3px solid var(--primary);
}

.note-item .meta,
.activity-item .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.activity-item .type {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-subtle);
  color: var(--primary);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: toast-in 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-2);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* View Transitions */
#view-container {
  animation: view-in 0.2s ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1200px) {
  .velocity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .today-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  
  .sidebar .nav-text,
  .sidebar .nav-section-title,
  .sidebar .sidebar-footer-content {
    opacity: 0;
    width: 0;
  }
  
  .content {
    margin-left: var(--sidebar-collapsed);
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .velocity-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-header-actions {
    justify-content: flex-start;
  }
}

/* ============================================================================
   PRINT
   ============================================================================ */
@media print {
  .sidebar,
  .global-header,
  .cmd-palette,
  .modal {
    display: none !important;
  }
  
  .content {
    margin: 0;
    padding: 0;
  }
}

/* Manufacturing nav section */
.nav-section {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1rem 1rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Manufacturing Module Polish */
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.detail-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text);
}

.detail-table {
  width: 100%;
}

.detail-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-table td:first-child {
  color: var(--text-muted);
  width: 40%;
}

/* Quick action buttons in tables */
.quick-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.7;
  transition: all 0.15s;
}

.quick-btn:hover {
  opacity: 1;
  background: var(--surface-2);
}

/* Status badges */
.status-planned { background: #dbeafe; color: #1e40af; }
.status-released { background: #fef3c7; color: #92400e; }
.status-in_progress { background: #d1fae5; color: #065f46; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-draft { background: #f3f4f6; color: #374151; }
.status-submitted { background: #fef3c7; color: #92400e; }
.status-received { background: #d1fae5; color: #065f46; }

/* MRP results styling */
#mrp-results table {
  margin-top: 1rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}
