/* ═══════════════════════════════════════════════════════════
   DevOffSales Design System
   Colors, Typography, Spacing, Components
   ═══════════════════════════════════════════════════════════ */

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

:root {
  /* ── Colors ── */
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --primary-dark: #1E3A8A;
  --primary-50: #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;

  --accent: #059669;
  --accent-light: #10B981;
  --accent-dark: #047857;
  --accent-50: #ECFDF5;

  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-hover: #F3F4F6;
  --surface-active: #E5E7EB;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;

  --success: #059669;
  --success-light: #ECFDF5;
  --success-text: #065F46;
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --warning-text: #92400E;
  --error: #DC2626;
  --error-light: #FEF2F2;
  --error-text: #991B1B;
  --info: #2563EB;
  --info-light: #EFF6FF;
  --info-text: #1E40AF;

  /* Pipeline stage colors */
  --stage-new: #3B82F6;
  --stage-analysis: #8B5CF6;
  --stage-proposal: #6366F1;
  --stage-negotiation: #F59E0B;
  --stage-won: #059669;
  --stage-lost: #DC2626;

  /* ── Typography ── */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Border Radius ── */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

  /* ── Layout ── */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --header-height: 64px;

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease-out;
}

/* ═══════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════ */

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ═══════════════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════════════ */

.text-display { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.text-h1 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.text-h2 { font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.text-h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.text-body { font-size: 14px; font-weight: 400; line-height: 1.5; }
.text-small { font-size: 13px; font-weight: 400; line-height: 1.45; }
.text-tiny { font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: 0.02em; }
.text-overline { font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-light); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════
   Layout: App Shell
   ═══════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-base);
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  margin-left: var(--space-3);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-2);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-1);
}

.nav-section-label {
  padding: var(--space-5) var(--space-3) var(--space-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  color: var(--text-secondary);
  height: 40px;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

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

.nav-item-text {
  white-space: nowrap;
  font-size: 14px;
}

.nav-badge {
  margin-left: auto;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--surface-hover);
}

/* Main area */
.main-area,
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Header */
.header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  z-index: 30;
}

.header-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: var(--space-3);
}

.header-spacer { flex: 1; }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

.header-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.header-icon-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.user-avatar:hover { opacity: 0.9; }

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--bg);
}

/* ═══════════════════════════════════════════════════════════
   Components
   ═══════════════════════════════════════════════════════════ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover { background: #B91C1C; }

.btn-success {
  background: var(--accent);
  color: white;
}
.btn-success:hover { background: var(--accent-dark); }

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.btn-icon {
  width: 40px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

/* KPI Stat Cards */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--error); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-error { background: var(--error-light); color: var(--error-text); }
.badge-info { background: var(--info-light); color: var(--info-text); }
.badge-neutral { background: var(--surface-hover); color: var(--text-muted); }
.badge-purple { background: #EDE9FE; color: #7C3AED; }

.badge-stage-new { background: #DBEAFE; color: #1D4ED8; }
.badge-stage-analysis { background: #EDE9FE; color: #7C3AED; }
.badge-stage-proposal { background: #E0E7FF; color: #4338CA; }
.badge-stage-negotiation { background: #FEF3C7; color: #92400E; }
.badge-stage-won { background: var(--success-light); color: var(--success-text); }
.badge-stage-lost { background: var(--error-light); color: var(--error-text); }

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}

tbody tr:hover {
  background: var(--primary-50);
}

tbody tr.selected {
  background: var(--primary-50);
  border-left: 3px solid var(--primary);
}

tbody td {
  padding: 12px 16px;
  font-size: 14px;
  height: 52px;
  vertical-align: middle;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

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

.form-input {
  width: 100%;
  height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.form-input::placeholder { color: var(--text-light); }

.form-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  resize: vertical;
  height: auto;
  line-height: 1.5;
}

.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.form-textarea::placeholder { color: var(--text-light); }

.form-select {
  width: 100%;
  height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row > .form-group {
  flex: 1;
  min-width: 0;
}

/* Search */
.search-input {
  position: relative;
}

.search-input input {
  width: 100%;
  height: 40px;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.tab {
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Filter chips */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  user-select: none;
}

.filter-chip:hover {
  background: var(--surface-hover);
}

.filter-chip.active {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary);
}

/* Modal / Drawer */
.modal-overlay {
  backdrop-filter: blur(4px);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 60;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 61;
  width: 640px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-sm { width: 440px; }
.modal-md { width: 640px; }
.modal-lg { width: 800px; }

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

.modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--error-bg, #fef2f2);
  color: var(--error);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  z-index: 51;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 250ms ease;
}

.drawer.active,
.drawer.drawer-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.drawer-close:hover {
  background: var(--error-bg, #fef2f2);
  color: var(--error);
}

.drawer-body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

/* Toast */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  width: 360px;
  max-width: 90vw;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-left: 4px solid var(--border);
  animation: slideInRight 300ms ease-out;
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--error); }
.toast-info { border-left-color: var(--info); }

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

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--surface-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 500ms ease;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border-light) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   Kanban Board
   ═══════════════════════════════════════════════════════════ */

.kanban-board {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  height: calc(100vh - var(--header-height) - 140px);
  min-width: 0;
  scroll-behavior: smooth;
}

.kanban-column {
  min-width: 220px;
  width: 220px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-md);
  max-height: 100%;
  overflow: hidden;
}

/* When there's enough space, let columns grow to fill */
@media (min-width: 1600px) {
  .kanban-column {
    flex: 1 1 220px;
  }
}

.kanban-column-header {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

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

.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.kanban-column-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.kanban-column-value {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Kanban classes used by JS (kanban-header, kanban-dot, kanban-count) */
.kanban-header {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: var(--space-1);
  min-width: 0;
}

.kanban-header-title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
}

.kanban-header-title .fw-600 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.kanban-header > .text-small {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
}

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

.kanban-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.kanban-empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--text-light);
  font-size: 13px;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-1) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: box-shadow var(--transition-base), transform var(--transition-fast);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  opacity: 0.9;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card inner text overflow */
.kanban-card .text-body {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card .text-small {
  font-size: 11px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.kanban-card-value {
  font-weight: 600;
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.ml-auto { margin-left: auto; }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 50;
  }
  .sidebar.sidebar-mobile-open {
    transform: translateX(0);
  }
  .sidebar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
  }
  .sidebar-mobile-overlay.active {
    display: block;
  }
  .content {
    padding: var(--space-4);
  }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
  .modal { width: 95vw; }
  .kanban-board { height: auto; min-height: 400px; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .header-title { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════════════════════ */

.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  width: 420px;
  max-width: 90vw;
  text-align: center;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 auto var(--space-6);
}

.login-logo-img {
  height: 44px;
  width: auto;
}

.demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
}

.demo-accounts-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-align: center;
}

.demo-account-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  text-align: left;
  font-family: var(--font-sans);
}

.demo-account-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.08);
}

.demo-account-btn .demo-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.demo-account-btn .demo-info {
  flex: 1;
  min-width: 0;
}

.demo-account-btn .demo-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.demo-account-btn .demo-role {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.demo-account-btn .demo-email {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.3;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--text-light);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.google-btn:hover {
  background: var(--surface-hover);
  box-shadow: var(--shadow-sm);
}

/* User dropdown — base rule (overridden by sidebar-specific rule below) */
.user-dropdown {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 60;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.user-dropdown-item:first-child { padding-top: var(--space-3); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.user-dropdown-item:last-child { padding-bottom: var(--space-3); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.user-dropdown-item:hover { background: var(--surface-hover); }

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-1) 0;
}

/* Activity feed */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

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

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong { color: var(--text); font-weight: 500; }

.activity-time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Page Toolbar — search + sort + new button row */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-toolbar .toolbar-left {
  flex: 1;
  min-width: 0;
}

.page-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.toolbar-spacer { flex: 1; }

/* View toggle */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  cursor: pointer;
  background: var(--surface);
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--border);
}

.view-toggle-btn.active {
  background: var(--primary-50);
  color: var(--primary);
}

/* Lead score */
.lead-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  border: 2px solid;
  flex-shrink: 0;
}

.lead-score.high, .lead-score.score-hot { border-color: var(--success); color: var(--success-text); background: var(--success-light); }
.lead-score.medium, .lead-score.score-warm { border-color: var(--warning); color: var(--warning-text); background: var(--warning-light); }
.lead-score.low, .lead-score.score-cold { border-color: var(--text-light); color: var(--text-muted); background: var(--surface-hover); }

/* Interaction timeline */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-4);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 7px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--surface);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.timeline-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Chat interface (tasks) */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-message {
  max-width: 80%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
}

.chat-message.ai {
  background: var(--surface-hover);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.chat-message.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-input-area {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}

.chat-input-area input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

/* Funnel chart (CSS only) */
.funnel,
.funnel-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 0;
}

.funnel-stage,
.funnel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.funnel-bar-container {
  flex: 1;
  min-width: 0;
}

.funnel-bar {
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  color: white;
  font-size: 12px;
  font-weight: 600;
  transition: width 500ms ease;
}

.funnel-bar-new { background: var(--stage-new); }
.funnel-bar-needs_analysis { background: var(--stage-analysis); }
.funnel-bar-proposal { background: var(--stage-proposal); }
.funnel-bar-negotiation { background: var(--stage-negotiation); }
.funnel-bar-won { background: var(--stage-won); }
.funnel-bar-lost { background: var(--stage-lost); }

.funnel-count {
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.funnel-label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
}

/* Bar Chart (CEO Dashboard) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  justify-content: space-between;
  padding: var(--space-4) 0;
  min-height: 240px;
}
.bar-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.bar-chart-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.bar-chart-bar {
  width: 100%;
  max-width: 60px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 500ms ease;
}
.bar-chart-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.funnel-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
}

/* Email preview */
.email-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.email-preview-header {
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.email-field {
  display: flex;
  gap: var(--space-2);
  font-size: 13px;
}

.email-field-label {
  color: var(--text-muted);
  min-width: 50px;
}

.email-field-value { color: var(--text); }

.email-preview-body {
  padding: var(--space-4);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-line;
}

/* Settings sections */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}

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

.settings-row-label {
  font-size: 14px;
  color: var(--text);
}

.settings-row-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-row-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Toggle switch */
.toggle {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
}

.toggle.active { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.toggle.active::after { transform: translateX(20px); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

.pagination-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pagination-btn:hover { background: var(--surface-hover); }
.pagination-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Quick actions */
.quick-actions {
  display: flex;
  gap: var(--space-2);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.quick-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   Tasks Page — Split Layout
   ═══════════════════════════════════════════════════════════ */

.tasks-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: var(--space-4);
  min-height: 500px;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-y: auto;
  max-height: 700px;
}

.task-item {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.task-item:hover { background: var(--surface-hover); }
.task-item-selected { background: var(--primary-50) !important; border-left: 3px solid var(--primary); }

.task-type-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.tasks-preview {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-y: auto;
  max-height: 700px;
}

.task-preview-content { padding: 24px; }

.email-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 16px;
}

.email-header {
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.email-body { padding: 16px 20px; }

/* ═══════════════════════════════════════════════════════════
   Settings Page — Layout
   ═══════════════════════════════════════════════════════════ */

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
}

.settings-nav-item:hover { background: var(--surface-hover); color: var(--text); }

.settings-nav-active {
  background: var(--primary-50) !important;
  color: var(--primary) !important;
  font-weight: 500;
}

.form-input-sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   Detail Rows (Drawers)
   ═══════════════════════════════════════════════════════════ */

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-section { padding: 4px 0; }

.stat-card {
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════
   KPI Grid
   ═══════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════
   Project Grid
   ═══════════════════════════════════════════════════════════ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.project-card { transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,.08); }

/* Overdue milestone indicator on project cards */
.overdue-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 12px;
  font-weight: 500;
}
.overdue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Overdue milestone row in drawer */
.milestone-overdue {
  background: color-mix(in srgb, var(--error) 6%, var(--bg-secondary)) !important;
}

/* ═══════════════════════════════════════════════════════════
   Quick Actions Grid (Dashboard)
   ═══════════════════════════════════════════════════════════ */

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.quick-action-card:hover { background: var(--surface-hover); border-color: var(--border); }

/* Quick action items in modal */
.quick-action-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.quick-action-item:hover { background: var(--surface-hover); }

/* ═══════════════════════════════════════════════════════════
   User Dropdown (sidebar override)
   ═══════════════════════════════════════════════════════════ */

.user-dropdown {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
  z-index: 50;
  margin-bottom: 8px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover { background: var(--surface-hover); }

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════
   Dashboard Grid
   ═══════════════════════════════════════════════════════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════
   Missing Layout Classes
   ═══════════════════════════════════════════════════════════ */

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-3);
  height: var(--header-height);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-logo-img {
  height: 32px;
  width: auto;
}

/* Header layout */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}

.header-search input {
  height: 36px;
  padding: 0 var(--space-3) 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  min-width: 240px;
  transition: border-color var(--transition-fast);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary-light);
}

.header-notification {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.sidebar-mobile-toggle {
  display: none;
}

/* Sidebar user section */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--surface-hover);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* User dropdown — final sidebar position */
.user-dropdown {
  position: absolute;
  bottom: 60px;
  left: var(--space-3);
  right: var(--space-3);
  overflow: hidden;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--text);
  transition: background var(--transition-fast);
}

.user-dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* Clients grid */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

/* Card hover effect */
.card-hover {
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.08);
}

/* Quick action items (modal) */
.quick-action-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  transition: background var(--transition-fast);
}

.quick-action-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Nav badge warning variant */
.nav-badge-warning {
  background: var(--warning);
}

/* ═══════════════════════════════════════════════════════════
   Authentication
   ═══════════════════════════════════════════════════════════ */

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-6);
}

.auth-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-size: var(--text-sm);
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.input-password-wrapper {
  position: relative;
}

.input-password-wrapper input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--text);
}

.password-strength {
  margin-top: 6px;
}

.password-strength-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-label {
  font-size: 11px;
  margin-top: 3px;
  color: var(--text-muted);
}

/* Role selection cards */
.role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.role-card {
  padding: var(--space-4);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg);
}

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

.role-card.selected {
  border-color: var(--accent);
  background: rgba(5, 150, 105, 0.05);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.role-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
}

.role-icon-cto { background: rgba(99, 102, 241, 0.1); color: #6366F1; }
.role-icon-ceo { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.role-icon-coo { background: rgba(5, 150, 105, 0.1); color: var(--accent); }

.role-card h4 {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: var(--text-sm);
}

.role-card p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* Registration steps */
.register-step {
  display: none;
}

.register-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.register-success {
  text-align: center;
  padding: var(--space-6) 0;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: rgba(5, 150, 105, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--success);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

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

/* ═══════════════════════════════════════════════════════════
   Search Dropdown
   ═══════════════════════════════════════════════════════════ */

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  margin-top: 4px;
}

.search-dropdown.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

.search-category {
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-active {
  background: var(--surface-hover);
}

.search-result-type {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.search-result-type.client { background: rgba(30, 64, 175, 0.1); color: var(--primary); }
.search-result-type.prospect { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.search-result-type.project { background: rgba(5, 150, 105, 0.1); color: var(--accent); }
.search-result-type.invoice { background: rgba(99, 102, 241, 0.1); color: #6366F1; }

.search-result-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.search-result-name mark {
  background: rgba(245, 158, 11, 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.search-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════
   Notification Panel
   ═══════════════════════════════════════════════════════════ */

.notification-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notification-panel.open {
  right: 0;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.notification-panel-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.notification-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

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

.notification-item.unread {
  background: rgba(30, 64, 175, 0.03);
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.notification-dot.overdue { background: var(--error); }
.notification-dot.warning { background: var(--warning); }
.notification-dot.info { background: var(--info); }
.notification-dot.task { background: var(--accent); }

.notification-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════
   Repository Viewer
   ═══════════════════════════════════════════════════════════ */

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-4);
}

.repo-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.repo-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.repo-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.repo-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.repo-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

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

.repo-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.repo-lang {
  display: flex;
  align-items: center;
  gap: 5px;
}

.repo-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.repo-badge-private,
.repo-badge-public {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.repo-badge-private {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.repo-badge-public {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Repo detail drawer */
.repo-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.repo-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  gap: 0;
}

.repo-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.repo-tab:hover {
  color: var(--text);
}

.repo-tab.repo-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* File tree */
.file-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text);
}

.file-tree-item:hover {
  background: var(--surface-hover);
}

.file-tree-item svg {
  flex-shrink: 0;
}

/* Commits */
.commit-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.commit-item:last-child {
  border-bottom: none;
}

.commit-message {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.commit-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.commit-hash {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  background: rgba(30, 64, 175, 0.06);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Pull Requests */
.pr-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

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

.pr-item:last-child {
  border-bottom: none;
}

.pr-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pr-icon.open { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.pr-icon.merged { background: rgba(99, 102, 241, 0.1); color: #6366F1; }
.pr-icon.closed { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.pr-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

.pr-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Diff viewer */
.diff-viewer {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  border: 1px solid var(--border-light);
}

.diff-viewer .diff-line {
  padding: 0 var(--space-3);
  white-space: pre;
}

.diff-viewer .diff-add {
  background: rgba(5, 150, 105, 0.08);
  color: var(--success);
}

.diff-viewer .diff-remove {
  background: rgba(239, 68, 68, 0.08);
  color: var(--error);
}

.diff-viewer .diff-header {
  background: rgba(30, 64, 175, 0.06);
  color: var(--primary);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

/* Code viewer */
.code-viewer {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  white-space: pre;
  max-height: 500px;
  overflow-y: auto;
}

/* Branch list */
.branch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.branch-item:last-child {
  border-bottom: none;
}

.branch-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.branch-default {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

/* PR comment */
.pr-comment {
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  border-left: 3px solid var(--border-light);
}

.pr-comment-author {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.pr-comment-body {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.pr-comment-date {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Repo README */
.repo-readme {
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.repo-readme h1, .repo-readme h2, .repo-readme h3 {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: 600;
}

.repo-readme h1 { font-size: var(--text-lg); }
.repo-readme h2 { font-size: var(--text-base); }
.repo-readme h3 { font-size: var(--text-sm); }

.repo-readme code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 3px;
}

.repo-readme ul {
  padding-left: var(--space-5);
  margin: var(--space-2) 0;
}

/* ═══════════════════════════════════════════════════════════
   Loading Spinner
   ═══════════════════════════════════════════════════════════ */

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  right: 10px;
  top: 50%;
  margin-top: -7px;
}

/* ═══════════════════════════════════════════════════════════
   Form Validation
   ═══════════════════════════════════════════════════════════ */

.form-input.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error {
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-error::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--error);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

.form-input:focus.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   Overdue Indicators
   ═══════════════════════════════════════════════════════════ */

.overdue-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--error);
  font-size: 12px;
  font-weight: 500;
}

.overdue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.milestone-overdue {
  border-left: 3px solid var(--error) !important;
}

/* Task approval flash */
.task-approved-flash {
  animation: approve-flash 600ms ease-out;
}

@keyframes approve-flash {
  0% { background: var(--success-light); }
  100% { background: transparent; }
}

.task-rejected-flash {
  animation: reject-flash 600ms ease-out;
}

@keyframes reject-flash {
  0% { background: var(--error-light); }
  100% { background: transparent; }
}

/* ═══════════════════════════════════════════════════════════
   Confirmation Dialog
   ═══════════════════════════════════════════════════════════ */

.confirm-dialog {
  text-align: center;
  padding: var(--space-4) 0;
}

.confirm-icon {
  margin: 0 auto var(--space-4);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon-danger {
  background: var(--error-light);
  color: var(--error);
}

.confirm-icon-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.confirm-message {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════
   Empty States Enhanced
   ═══════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.4;
}

.empty-state-compact {
  padding: var(--space-6) var(--space-4);
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .tasks-layout { grid-template-columns: 1fr; }
  .tasks-preview { display: none; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .repo-grid { grid-template-columns: 1fr; }
  .page-toolbar { flex-wrap: wrap; gap: 12px; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar-right { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: 1fr 1fr; }
  .role-cards { grid-template-columns: 1fr; }
  .notification-panel.open { width: 100%; }
  .header-search { display: none; }
  .header-right { gap: 8px; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100%; }
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-chips { flex-wrap: wrap; }
  .btn-group { flex-wrap: wrap; }
  .user-dropdown { bottom: auto; top: 100%; left: 0; right: auto; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { padding: var(--space-3); }
  .header { padding: var(--space-2) var(--space-4); }
  .content { padding: var(--space-3); }
}

/* ═══════════════════════════════════════════════════════════
   Focus-Visible Rings (Accessibility)
   ═══════════════════════════════════════════════════════════ */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:focus-visible,
.btn-icon:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   Disabled States
   ═══════════════════════════════════════════════════════════ */

.btn[disabled],
.btn.disabled,
button[disabled],
input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   Active Button States (Tactile Feedback)
   ═══════════════════════════════════════════════════════════ */

.btn:active:not([disabled]) {
  transform: scale(0.97);
}

.btn-icon:active:not([disabled]) {
  transform: scale(0.92);
}

/* ═══════════════════════════════════════════════════════════
   Form Input Success State
   ═══════════════════════════════════════════════════════════ */

.form-input.input-success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ═══════════════════════════════════════════════════════════
   Page Transition
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.content {
  animation: fadeIn 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════
   Custom Checkbox & Radio
   ═══════════════════════════════════════════════════════════ */

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

input[type="radio"]:checked {
  border-color: var(--primary);
}

input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ═══════════════════════════════════════════════════════════
   Quick Actions Bar — Dashboard Top
   ═══════════════════════════════════════════════════════════ */
.quick-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.quick-action-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover svg {
  stroke: white;
}

.quick-action-btn:active:not([disabled]) {
  transform: scale(0.97);
}

.quick-action-btn svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke var(--transition-fast);
}

@media (max-width: 768px) {
  .quick-actions-bar {
    gap: 6px;
  }
  .quick-action-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .quick-action-btn span {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   NEW COMPONENTS — March 2026 Rework
   ═══════════════════════════════════════════════════════════ */

/* ── Step Tracker (FedEx-style pipeline) ── */
.step-tracker {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 20px 12px;
  overflow-x: auto;
}
.step-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  max-width: 120px;
}
.step-node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-base);
  flex-shrink: 0;
}
.step-active .step-node {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}
.step-completed .step-node {
  background: var(--success);
  color: #fff;
}
.step-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.3;
}
.step-active .step-label { color: var(--primary); font-weight: 600; }
.step-completed .step-label { color: var(--success); }
.step-line {
  width: 40px;
  height: 2px;
  background: var(--border-light);
  margin-top: 17px;
  flex-shrink: 0;
}
.step-line-completed { background: var(--success); }
.step-line-active { background: linear-gradient(90deg, var(--success), var(--primary)); }

/* ── Connector Badge ── */
.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.connector-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.connector-badge:hover { border-color: var(--primary-light); background: var(--surface-hover); }
.connector-connected { border-color: var(--success); background: rgba(5, 150, 105, 0.04); }
.connector-icon { color: var(--text-muted); flex-shrink: 0; }
.connector-connected .connector-icon { color: var(--text); }
.connector-info { flex: 1; min-width: 0; }
.connector-name { font-size: 13px; font-weight: 600; color: var(--text); }
.connector-status { font-size: 11px; color: var(--text-muted); }
.connector-connected .connector-status { color: var(--success); }
.connector-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--success); }
.dot-gray { background: var(--border); }

/* ── Document Card ── */
.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.document-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}
.document-card:hover { border-color: var(--primary-light); }
.document-icon { flex-shrink: 0; }
.document-info { flex: 1; min-width: 0; }
.document-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Credential Row ── */
.credential-row td { padding: 10px 12px; font-size: 13px; }
.password-masked { font-size: 13px; color: var(--text-muted); letter-spacing: 2px; }

/* ── Chat Interface ── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 300px);
  min-height: 400px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: chatFadeIn 0.3s ease;
}
.chat-bubble-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble-ai { align-self: flex-start; }
.chat-avatar-ai, .chat-avatar-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-avatar-ai { background: var(--primary); color: #fff; }
.chat-avatar-user { background: var(--accent); color: #fff; }
.chat-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-bubble-ai .chat-content { background: var(--bg-primary); border: 1px solid var(--border-light); color: var(--text); }
.chat-bubble-user .chat-content { background: var(--primary); color: #fff; }
.chat-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.chat-bubble-user .chat-time { color: rgba(255,255,255,0.7); }
.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-primary);
}
.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
  background: var(--bg-secondary);
  color: var(--text);
}
.chat-input-bar input:focus { border-color: var(--primary); }
.chat-input-bar button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.chat-input-bar button:hover { background: var(--primary-dark); }
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Excel-style Table ── */
.excel-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.excel-table th {
  background: var(--bg-secondary);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.excel-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.excel-table tr:hover td { background: var(--surface-hover); }
.excel-cell-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text);
  border-radius: 4px;
  outline: none;
  transition: all var(--transition-fast);
}
.excel-cell-input:hover { border-color: var(--border-light); background: var(--bg-secondary); }
.excel-cell-input:focus { border-color: var(--primary); background: var(--bg-primary); box-shadow: 0 0 0 2px rgba(30,64,175,0.1); }
.excel-totals-row td {
  background: var(--bg-secondary);
  border-top: 2px solid var(--border);
  font-weight: 600;
}

/* ── Intelligence Card (Pre-Visio) ── */
.intelligence-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 12px;
}
.intelligence-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.intelligence-card h4:first-child { margin-top: 0; }
.intelligence-card ul { margin: 0; padding-left: 20px; }
.intelligence-card li { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.intelligence-card .insight-box {
  background: rgba(30, 64, 175, 0.05);
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--primary-dark);
}

/* ── Calendar ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.calendar-header-cell {
  background: var(--bg-secondary);
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.calendar-day {
  background: var(--bg-primary);
  min-height: 80px;
  padding: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.calendar-day:hover { background: var(--surface-hover); }
.calendar-day-other { opacity: 0.3; }
.calendar-day-today { background: rgba(30, 64, 175, 0.05); }
.calendar-day-number { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.calendar-day-today .calendar-day-number { background: var(--primary); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.calendar-event {
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.calendar-event-visio { background: rgba(30, 64, 175, 0.12); color: var(--primary); }
.calendar-event-meeting { background: rgba(5, 150, 105, 0.12); color: var(--accent); }
.calendar-event-call { background: rgba(234, 88, 12, 0.12); color: var(--warning); }
.calendar-event-deadline { background: rgba(220, 38, 38, 0.12); color: var(--error); }
.calendar-event-internal { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.calendar-event-demo { background: rgba(168, 85, 247, 0.12); color: #a855f7; }

/* ── Platform Dot ── */
.platform-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── Finance Summary Badge ── */
.finance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.finance-badge-green { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.finance-badge-yellow { background: rgba(234, 88, 12, 0.1); color: var(--warning); }
.finance-badge-red { background: rgba(220, 38, 38, 0.1); color: var(--error); }

/* ── Health Border (Project Cards) ── */
.project-card-healthy { border-left: 4px solid var(--success) !important; }
.project-card-atrisk { border-left: 4px solid var(--warning) !important; }
.project-card-critical { border-left: 4px solid var(--error) !important; }

/* ── Spinner animation ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { border: 2px solid var(--border-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }

/* ── Project Detail Tabs ── */
.project-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
  overflow-x: auto;
}
.project-detail-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.project-detail-tab:hover { color: var(--text); }
.project-detail-tab-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Writing Style Cards ── */
.style-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.style-card:hover { border-color: var(--primary-light); }
.style-card-active { border-color: var(--primary); background: rgba(30, 64, 175, 0.03); }
.style-card h4 { margin: 0 0 4px; font-size: 14px; }
.style-card p { margin: 0; font-size: 12px; color: var(--text-muted); }
.style-sample {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-line;
}

/* ── Ticket Mini Cards ── */
.ticket-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 1px;
}
.ticket-bar-completed { background: var(--success); }
.ticket-bar-inprogress { background: var(--warning); }
.ticket-bar-pending { background: var(--border-light); }

/* ── Overdue indicator ── */
.overdue-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--error);
  margin-bottom: 10px;
  font-weight: 500;
}
.overdue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--error);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════════════
   PRE-SALES MODULE STYLES
   ═══════════════════════════════════════════════════════════ */

/* ── Complexity Stars ── */
.complexity-stars { display: inline-flex; gap: 2px; }
.complexity-star { cursor: pointer; font-size: 16px; color: var(--border); transition: color var(--transition-fast); }
.complexity-star-filled { color: #f59e0b; }
.complexity-star:hover { color: #f59e0b; }

/* ── Tech Stack Chips ── */
.tech-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary);
  margin: 2px;
}
.tech-chip-react { background: rgba(97, 218, 251, 0.15); color: #0ea5e9; }
.tech-chip-node { background: rgba(104, 159, 56, 0.15); color: #689f38; }
.tech-chip-python { background: rgba(255, 193, 7, 0.15); color: #f59e0b; }
.tech-chip-aws { background: rgba(255, 153, 0, 0.12); color: #f97316; }
.tech-chip-vue { background: rgba(65, 184, 131, 0.15); color: #10b981; }
.tech-chip-flutter { background: rgba(69, 209, 253, 0.15); color: #06b6d4; }

/* ── Resource Allocation Bar ── */
.resource-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.resource-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-base);
}
.resource-bar-green .resource-bar-fill { background: var(--success); }
.resource-bar-yellow .resource-bar-fill { background: var(--warning); }
.resource-bar-red .resource-bar-fill { background: var(--error); }

/* ── Analytics Horizontal Bars ── */
.analytics-bar-container { margin-bottom: 12px; }
.analytics-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.analytics-bar-label span:first-child { font-weight: 500; color: var(--text); }
.analytics-bar-label span:last-child { color: var(--text-muted); }
.analytics-bar {
  height: 24px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.analytics-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  min-width: 30px;
  transition: width var(--transition-base);
}
.analytics-bar-primary { background: var(--primary); }
.analytics-bar-success { background: var(--success); }
.analytics-bar-warning { background: var(--warning); }
.analytics-bar-error { background: var(--error); }
.analytics-bar-info { background: var(--info, #3b82f6); }
.analytics-bar-purple { background: #8b5cf6; }

/* ── POC Criteria Checklist ── */
.poc-criteria { list-style: none; padding: 0; margin: 0; }
.poc-criteria li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.poc-criteria li:last-child { border-bottom: none; }
.poc-criteria input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.poc-criteria-checked { text-decoration: line-through; color: var(--text-muted); }

/* ── WBS Phase Header ── */
.wbs-phase-header {
  background: var(--bg-secondary);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light, rgba(30,64,175,0.2));
}
.wbs-phase-header td { background: var(--bg-secondary) !important; font-weight: 600; color: var(--primary); }

/* ── Cloud Alert ── */
.cloud-alert { border: 2px solid var(--error) !important; background: rgba(220, 38, 38, 0.03); }

/* ── Presales Kanban Card Extension ── */
.presales-card-complexity { display: flex; gap: 1px; margin-top: 4px; }
.presales-card-tech { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
