/* ═══════════════════════════════════════════════════════════════════════════════
   PIPEDASH — Apple Design System
   Inspired by macOS Sonoma, SF Pro, Apple HIG
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  /* Apple System Colors */
  --apple-blue: #007AFF;
  --apple-blue-hover: #0062CC;
  --apple-blue-light: rgba(0,122,255,0.08);
  --apple-blue-tint: rgba(0,122,255,0.12);
  --apple-green: #34C759;
  --apple-green-light: rgba(52,199,89,0.1);
  --apple-orange: #FF9500;
  --apple-orange-light: rgba(255,149,0,0.1);
  --apple-red: #FF3B30;
  --apple-red-light: rgba(255,59,48,0.08);
  --apple-purple: #AF52DE;
  --apple-pink: #FF2D55;
  --apple-teal: #5AC8FA;
  --apple-indigo: #5856D6;

  /* Semantic */
  --primary: var(--apple-blue);
  --primary-hover: var(--apple-blue-hover);
  --primary-light: var(--apple-blue-light);
  --success: var(--apple-green);
  --success-light: var(--apple-green-light);
  --warning: var(--apple-orange);
  --warning-light: var(--apple-orange-light);
  --danger: var(--apple-red);
  --danger-light: var(--apple-red-light);

  /* Sidebar — Dark Vibrancy */
  --sidebar-bg: rgba(28,28,30,0.96);
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-text-hover: rgba(255,255,255,0.85);
  --sidebar-active-bg: rgba(0,122,255,0.18);
  --sidebar-active-text: #0A84FF;

  /* Surfaces */
  --page-bg: #F2F2F7;
  --card-bg: #FFFFFF;
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.04);
  --separator: rgba(60,60,67,0.12);

  /* Text — Apple's opacity-based text */
  --text-primary: rgba(0,0,0,0.85);
  --text-secondary: rgba(60,60,67,0.6);
  --text-muted: rgba(60,60,67,0.3);

  /* Shadows — Apple's layered shadows */
  --shadow-sm: 0 0.5px 1px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.06);
  --shadow-card: 0 0.5px 0 rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);

  /* Radius — Apple's generous rounding */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* Font — System font stack (SF Pro on Apple devices) */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv01';
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  border-left: none;
  border-radius: 8px;
  margin: 1px 0;
  letter-spacing: -0.01em;
}

.nav-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,0.06);
}

.nav-item-sub {
  font-size: 0.8rem;
  padding: 7px 12px;
}
.nav-item-settings {
  font-size: 0.775rem;
  padding: 6px 12px 6px 20px;
}
.nav-item.active {
  color: #FFFFFF;
  background: var(--sidebar-active-bg);
  font-weight: 600;
  border-left: none;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item.active .nav-icon { opacity: 1; }

.nav-section {
  margin-top: 16px;
}

.nav-section-title {
  display: block;
  padding: 8px 12px 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.28);
}

.nav-pipeline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  color: var(--sidebar-text);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  border-radius: 8px;
  border-left: none;
}

.nav-pipeline:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,0.06);
}

.nav-pipeline.active {
  color: #FFFFFF;
  background: var(--sidebar-active-bg);
  border-left: none;
}

.nav-pipeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Main Layout ───────────────────────────────────────────────────────────── */

.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-bg);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(242,242,247,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 52px;
}

.search-container {
  position: relative;
  max-width: 360px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}

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

.search-input:focus {
  background: white;
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15), var(--shadow-sm);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  margin-top: 6px;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.page-content {
  flex: 1;
  padding: 24px;
}

/* ─── Page Header ───────────────────────────────────────────────────────────── */

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

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.page-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

/* ─── Buttons — Apple HIG Style ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1.35;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  white-space: nowrap;
  user-select: none;
  position: relative;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: scale(1.02);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
  border: none;
}
.btn-secondary:hover { background: rgba(0,0,0,0.08); }
.btn-secondary:active { transform: scale(0.98); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255,59,48,0.14); }

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.btn-icon:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }

/* ─── Data Table — Clean Apple List Style ────────────────────────────────────── */

.data-table-wrapper {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
  gap: 12px;
}

.data-table-search {
  padding: 7px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: var(--font);
  outline: none;
  width: 260px;
  transition: all 0.2s ease;
  background: rgba(0,0,0,0.04);
}
.data-table-search:focus {
  background: white;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15), var(--shadow-sm);
}

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

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--separator);
  background: rgba(0,0,0,0.015);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--text-primary); }

.data-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.6rem;
  color: var(--text-muted);
}
.data-table th.sort-asc .sort-arrow,
.data-table th.sort-desc .sort-arrow { color: var(--primary); }

.data-table td {
  padding: 11px 16px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0,0,0,0.035);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: rgba(0,122,255,0.03); }
.data-table tbody tr.selected { background: var(--apple-blue-light); }

.data-table td a { color: var(--primary); text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }

.data-table .cell-name {
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.data-table .cell-name:hover { color: var(--primary); }

.data-table .cell-phone a { color: var(--text-primary); text-decoration: none; }
.data-table .cell-phone a:hover { color: var(--primary); }

/* ─── Phase Filter — Apple Segmented Control Style ───────────────────────────── */

.phase-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.phase-filter-btn {
  padding: 6px 14px;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1.4;
  border-radius: 100px;
  border: none;
  background: rgba(0,0,0,0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  user-select: none;
  letter-spacing: -0.01em;
}
.phase-filter-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text-primary);
}
.phase-filter-btn.active {
  color: white;
  border-color: transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--separator);
}

.pagination-info {
  font-size: 0.775rem;
  color: var(--text-secondary);
}

.pagination-buttons { display: flex; gap: 3px; }

.pagination-btn {
  padding: 5px 10px;
  font-size: 0.775rem;
  font-family: var(--font);
  border: none;
  background: rgba(0,0,0,0.04);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
}
.pagination-btn:hover { background: rgba(0,0,0,0.07); }
.pagination-btn.active {
  background: var(--primary);
  color: white;
}
.pagination-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── Modal — Apple Sheet Style ─────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.15), 0 0 0 0.5px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  margin: 16px;
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-close {
  background: rgba(0,0,0,0.04);
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 6px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.modal-close:hover { background: rgba(0,0,0,0.08); color: var(--text-primary); }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 18px 20px;
  border-top: 1px solid var(--separator);
}

/* ─── Forms — Apple-style Inputs ─────────────────────────────────────────────── */

.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: var(--font);
  outline: none;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  color: var(--text-primary);
  background: white;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

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

textarea.form-input {
  resize: vertical;
  min-height: 68px;
}

/* ─── Settings ──────────────────────────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.settings-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: var(--shadow-card);
}
.settings-card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.015);
}

.settings-card-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary);
}

.settings-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.settings-card-desc {
  font-size: 0.775rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ─── Kanban Board ──────────────────────────────────────────────────────────── */

.board-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}

.board-column {
  width: 300px;
  min-width: 300px;
  background: rgba(0,0,0,0.02);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 2px solid;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

.column-count {
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(255,255,255,0.85);
  padding: 2px 8px;
  border-radius: 100px;
}

.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 60px;
}

.column-footer {
  padding: 4px 14px;
  text-align: right;
}

/* Deal card */
.deal-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: grab;
  border: none;
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: var(--shadow-card);
}
.deal-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px) scale(1.01);
}
.deal-card:active { cursor: grabbing; transform: scale(0.99); }

.deal-card .card-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.deal-card .card-contact {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.deal-card .card-ad-situation {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.deal-card .card-answered-questions {
  font-size: 0.725rem;
  color: var(--text-primary);
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--page-bg);
  border-radius: 8px;
  white-space: pre-wrap;
  max-height: 56px;
  overflow: hidden;
  line-height: 1.4;
}

.deal-card .card-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  margin-top: 6px;
}

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.card-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: white;
  padding: 2px 7px;
  border-radius: 5px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.inline-add-btn {
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 0.775rem;
  font-family: var(--font);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}
.inline-add-btn:hover { color: var(--text-secondary); }

/* ─── View Toggle — Apple Segmented Control ──────────────────────────────────── */

.view-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.05);
  border-radius: 9px;
  padding: 2px;
}

.view-toggle-btn {
  padding: 6px 14px;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  background: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.view-toggle-btn.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  font-weight: 600;
}

/* ─── Pipeline Overview Cards ───────────────────────────────────────────────── */

.pipeline-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: var(--shadow-card);
}
.pipeline-card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.01);
}

.pipeline-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.pipeline-card-stats {
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ─── Comments ──────────────────────────────────────────────────────────────── */

.comment-item {
  background: rgba(0,0,0,0.02);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.comment-author { font-size: 0.75rem; font-weight: 600; color: var(--text-primary); }
.comment-date { font-size: 0.65rem; color: var(--text-muted); }

.comment-delete {
  margin-left: auto;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.comment-delete:hover { color: var(--danger); background: var(--danger-light); }

.comment-text { font-size: 0.8rem; color: var(--text-primary); white-space: pre-wrap; line-height: 1.5; }

/* ─── Label Toggles ─────────────────────────────────────────────────────────── */

.label-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.725rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid rgba(0,0,0,0.1);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}
.label-toggle input { display: none; }
.label-toggle.active {
  background: var(--label-color);
  border-color: var(--label-color);
  color: white;
}

/* ─── Badges ───────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 100px;
}

.badge-gray { background: rgba(0,0,0,0.05); color: var(--text-secondary); }
.badge-blue { background: var(--apple-blue-light); color: var(--apple-blue); }
.badge-green { background: var(--apple-green-light); color: var(--apple-green); }
.badge-red { background: var(--apple-red-light); color: var(--apple-red); }

/* ─── Sortable ──────────────────────────────────────────────────────────────── */

.sortable-ghost { opacity: 0.3; }
.sortable-chosen { box-shadow: var(--shadow-lg); transform: rotate(1deg) scale(1.03); }

/* ─── Scrollbar — macOS Style ────────────────────────────────────────────────── */

.column-cards::-webkit-scrollbar { width: 6px; }
.column-cards::-webkit-scrollbar-track { background: transparent; }
.column-cards::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}
.column-cards::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ─── Checkbox ──────────────────────────────────────────────────────────────── */

.checkbox-cell { width: 40px; text-align: center; }
.row-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ─── Empty State ───────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 14px; }
.empty-state-text { font-size: 0.875rem; }

/* ─── Deal Panel — Apple Sheet ──────────────────────────────────────────────── */

.slideover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideover-backdrop.visible { opacity: 1; }

.slideover-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 620px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 60px);
  background: #FBFBFD;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px rgba(0,0,0,0.18), 0 0 0 0.5px rgba(0,0,0,0.08);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease;
  opacity: 0;
}
.slideover-panel.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.slideover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--separator);
  flex-shrink: 0;
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.slideover-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.slideover-close {
  background: rgba(0,0,0,0.04);
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.slideover-close:hover { background: rgba(0,0,0,0.08); color: var(--text-primary); }

.slideover-tabs {
  display: flex;
  border-bottom: 1px solid var(--separator);
  padding: 0 22px;
  flex-shrink: 0;
  background: white;
}

.slideover-tab {
  padding: 10px 16px;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.slideover-tab:hover { color: var(--text-primary); }
.slideover-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.slideover-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.slideover-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--separator);
}
.slideover-section:last-child { border-bottom: none; }

.slideover-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.slideover-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
  background: white;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Info Rows ────────────────────────────────────────────────────────────── */

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.8rem;
}
.info-label { color: var(--text-secondary); }
.info-value { color: var(--text-primary); font-weight: 500; }

/* ─── Activity Items ───────────────────────────────────────────────────────── */

.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.035);
}
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 34px;
  height: 34px;
  background: var(--apple-blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.activity-content { flex: 1; min-width: 0; }

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.activity-type { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.activity-date { font-size: 0.7rem; color: var(--text-muted); }

.activity-notes {
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-top: 2px;
  line-height: 1.45;
}

.activity-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* ─── Toggle Switch — iOS Style ──────────────────────────────────────────────── */

.toggle-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.toggle-switch { display: none; }

.toggle-switch-label {
  width: 44px;
  height: 26px;
  background: rgba(0,0,0,0.15);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.toggle-switch-label::after {
  content: '';
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch:checked + .toggle-switch-label {
  background: var(--apple-green);
}
.toggle-switch:checked + .toggle-switch-label::after {
  transform: translateX(18px);
}

/* ─── Pipeline Filter Bar ──────────────────────────────────────────────────── */

.pipeline-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pipeline-search-input {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-family: var(--font);
  outline: none;
  width: 300px;
  transition: all 0.2s ease;
  background: rgba(0,0,0,0.04);
}
.pipeline-search-input:focus {
  background: white;
  box-shadow: 0 0 0 3px rgba(0,122,255,0.15), var(--shadow-sm);
}

/* ─── Page Size Select ─────────────────────────────────────────────────────── */

.page-size-select {
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font);
  outline: none;
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
  margin-left: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD — Apple Widgets Style
   ═══════════════════════════════════════════════════════════════════════════════ */

.dash-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Period — Apple Segmented Control */
.dash-period-btns {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.05);
  padding: 3px;
  border-radius: 10px;
}

.dash-period-btn {
  padding: 6px 14px;
  font-size: 0.775rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.dash-period-btn:hover { color: var(--text-primary); }
.dash-period-btn.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  font-weight: 600;
}

/* KPI Grid — Apple Widget Cards */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dash-kpi-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.dash-kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: scale(1.015);
}

.dash-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.dash-kpi-info { flex: 1; }

.dash-kpi-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.dash-kpi-label {
  font-size: 0.725rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* Two-Column Grid */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
}

/* Dashboard Card — Apple Widget */
.dash-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.dash-card-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dash-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-card-body { padding: 14px 18px 18px; }

.dash-empty {
  text-align: center;
  padding: 28px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.dash-empty-small {
  color: var(--text-muted);
  font-size: 0.775rem;
  padding: 8px 0;
}

/* Lead Sources */
.dash-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.dash-source-info {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
  flex-shrink: 0;
}

.dash-source-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dash-source-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-source-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.dash-source-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.32, 0.72, 0, 1);
  min-width: 4px;
}

.dash-source-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Pipeline Status */
.dash-pipeline-section {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.dash-pipeline-section:last-child { border-bottom: none; }

.dash-pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dash-pipeline-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-pipeline-meta {
  font-size: 0.725rem;
  color: var(--text-secondary);
}

.dash-progress-wrap {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
  margin-bottom: 8px;
  gap: 1.5px;
}

.dash-progress-seg {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.32, 0.72, 0, 1);
  min-width: 3px;
  cursor: help;
}

.dash-phase-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.dash-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Daily Chart */
.dash-chart-wrap {
  display: flex;
  gap: 6px;
  height: 180px;
  align-items: stretch;
}

.dash-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
  min-width: 24px;
  text-align: right;
}

.dash-chart-y span {
  font-size: 0.625rem;
  color: var(--text-muted);
  line-height: 1;
}

.dash-chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  border-left: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0 4px 22px;
  position: relative;
}

.dash-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
  position: relative;
}

.dash-chart-bar {
  width: 75%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--apple-blue) 0%, #0062CC 100%);
  border-radius: 5px 5px 2px 2px;
  transition: height 0.6s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  cursor: help;
  min-height: 2px;
}
.dash-chart-bar:hover {
  filter: brightness(1.1);
}

.dash-chart-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,28,30,0.95);
  color: white;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 0.65rem;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.dash-chart-bar:hover .dash-chart-tooltip { display: block; }

.dash-chart-label {
  position: absolute;
  bottom: -20px;
  font-size: 0.575rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Utilities ─────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
