/* ═══════════════════════════════════════════════════════════════════════════
   EDDA DEALFLOW · Design System
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Core palette - Light Theme (Edda default) */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f2f5;
  --bg-elevated: #ffffff;

  /* Border and shadow */
  --glass-bg: #ffffff;
  --glass-border: #e5e7eb;
  --glass-highlight: rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Text hierarchy */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-muted: #d1d5db;

  /* Edda brand colors */
  --accent-primary: #17403e;
  --accent-primary-rgb: 23, 64, 62;
  --accent-secondary: #10b981;
  --accent-success: #22c55e;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;
  --accent-info: #06b6d4;
  --accent-coral: #f87171;
  --accent-link: #14b8a6;

  /* Header */
  --header-bg: #1e293b;
  --header-text: #ffffff;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography - Sans-serif like desktop */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Consolas', monospace;

  /* Sizing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
}

/* Dark Theme */
.dark-theme {
  /* Core palette - Dark */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-elevated: #1e293b;

  /* Border and shadow - Dark */
  --glass-bg: #1e293b;
  --glass-border: #334155;
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

  /* Text hierarchy - Dark */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  /* Header - Dark */
  --header-bg: #0f172a;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Theme Toggle
   ═══════════════════════════════════════════════════════════════════════════ */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.theme-toggle__label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-toggle__switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  transition: all 0.3s ease;
}

.theme-toggle__switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.theme-toggle__switch::after {
  content: '🌙';
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font-size: 12px;
  transition: opacity 0.3s ease;
}

.theme-toggle--light .theme-toggle__switch {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.theme-toggle--light .theme-toggle__switch::before {
  left: calc(100% - 22px);
  background: white;
}

.theme-toggle--light .theme-toggle__switch::after {
  content: '☀️';
  right: auto;
  left: 6px;
}

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

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  padding-top: calc(var(--space-xl) + var(--safe-top));
  padding-bottom: calc(var(--space-xl) + var(--safe-bottom));
  background: radial-gradient(50% 50% at 50% 50%, #f5ea7f 40%, hsla(57, 66%, 75%, 0) 100%);
  background-color: #d1deda;
}

.dark-theme .login-page {
  background: radial-gradient(50% 50% at 50% 50%, rgba(30, 58, 47, 0.5) 0%, transparent 100%);
  background-color: #0f172a;
}

.login-page__icon {
  margin-bottom: var(--space-lg);
}

.login-page__icon img {
  height: 48px;
  width: auto;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.login-card__header {
  margin-bottom: var(--space-xl);
}

.login-card__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.login-card__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.login-card__theme-toggle {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
}

.login-page__logo {
  margin-top: var(--space-xl);
}

.login-page__logo img {
  height: 32px;
  width: auto;
  opacity: 0.7;
}

.dark-theme .login-page__logo img {
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

.login-page__copyright {
  margin-top: var(--space-lg);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Login Button - dark green style like desktop */
.btn--login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: #1e3a2f;
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--space-sm);
}

.btn--login:hover:not(:disabled) {
  background: #2d5445;
}

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

.btn--login.btn--loading {
  position: relative;
  color: transparent !important;
}

.btn--login.btn--loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Login form specific input styling */
.login-card .form-input {
  background: #f8faf8;
  border: 1px solid #e8ebe8;
  border-radius: var(--radius-md);
}

.login-card .form-input:focus {
  background: #ffffff;
  border-color: var(--accent-primary);
}

.dark-theme .login-card .form-input {
  background: var(--bg-tertiary);
  border-color: var(--glass-border);
}

/* Region Selector */
.region-select {
  position: relative;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.region-select__icon {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.625rem;
  color: var(--text-tertiary);
  pointer-events: none;
}

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

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.text-mono { font-family: var(--font-mono); }
.text-sans { font-family: var(--font-primary); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }

.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-error { color: var(--accent-error); }

/* ═══════════════════════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-md);
  padding-top: calc(var(--space-md) + var(--safe-top));
  padding-bottom: calc(var(--space-md) + var(--safe-bottom));
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  padding-top: calc(var(--space-lg) + var(--safe-top));
  padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
}

.view-centered {
  justify-content: center;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Card
   ═══════════════════════════════════════════════════════════════════════════ */

.glass-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.glass-card--elevated {
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn--primary {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

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

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

.btn--ghost:hover:not(:disabled) {
  background: var(--glass-highlight);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn--outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.btn--outline:hover:not(:disabled) {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.btn--block {
  width: 100%;
}

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

.btn--loading {
  position: relative;
  color: transparent !important;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn--primary.btn--loading::after {
  border-top-color: white;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════════════════ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  padding-top: calc(var(--space-md) + var(--safe-top));
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header--gradient {
  background: linear-gradient(135deg,
    #e0d4ec 0%,
    #dce4ed 25%,
    #f5f5f7 50%,
    #f5f5f7 100%
  );
  border-bottom: 1px solid rgba(200, 180, 220, 0.3);
}

.dark-theme .header--gradient {
  background: linear-gradient(135deg,
    #2a2440 0%,
    #1f2530 25%,
    #1a1a1a 60%,
    #1a1a1a 100%
  );
  border-bottom: 1px solid rgba(100, 80, 140, 0.2);
}

.dark-theme .header {
  background: var(--header-bg);
  border-bottom: none;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__logo {
  font-size: 1.25rem;
  color: var(--accent-primary);
}

.header__logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.header__title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.dark-theme .header__title {
  color: var(--header-text);
}

.header__workspace {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.dark-theme .header__workspace {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.header__search-btn:hover,
.header__search-btn:active {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.dark-theme .header__search-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
}

.dark-theme .header__search-btn:hover,
.dark-theme .header__search-btn:active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Status Indicator
   ═══════════════════════════════════════════════════════════════════════════ */

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.status--online .status__dot { background: var(--accent-success); }
.status--warning .status__dot { background: var(--accent-warning); }
.status--error .status__dot { background: var(--accent-error); }

.status--online .status__dot,
.status--warning .status__dot,
.status--error .status__dot {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Company Card
   ═══════════════════════════════════════════════════════════════════════════ */

.company-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.company-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.company-card--clickable {
  cursor: pointer;
}

.company-card--clickable:active {
  transform: scale(0.98);
}

.company-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.company-card__logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.company-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.company-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.company-card__stage {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-sm);
  color: var(--accent-secondary);
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.company-card__desc {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.company-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
}

.company-card__tag {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.company-card__tag--fund {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-secondary);
}

.company-card__tag--pipeline {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-secondary);
}

.company-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.company-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--glass-border);
  margin-top: var(--space-sm);
}

.company-card__date {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dashboard Controls (Pipeline Selector + View Toggle)
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.dashboard-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
}

/* Pipeline Selector */
.pipeline-selector {
  position: relative;
  flex: 1;
  min-width: 0;
}

.pipeline-selector__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pipeline-selector__btn:active {
  background: var(--bg-tertiary);
}

.pipeline-selector__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-selector__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.pipeline-selector__chevron--open {
  transform: rotate(180deg);
}

.pipeline-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.pipeline-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: background 0.15s ease;
}

.pipeline-dropdown__item:hover,
.pipeline-dropdown__item:active {
  background: var(--bg-tertiary);
}

.pipeline-dropdown__item--active {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.pipeline-dropdown__item--active .pipeline-dropdown__name {
  color: var(--accent-primary);
  font-weight: 600;
}

.pipeline-dropdown__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.pipeline-dropdown__count {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.pipeline-dropdown__empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* Dropdown animation */
.dropdown-enter-active,
.dropdown-leave-active {
  transition: all 0.2s ease;
}

.dropdown-enter-from,
.dropdown-leave-to {
  opacity: 0;
  transform: translateY(-8px);
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2px;
  flex-shrink: 0;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle__btn:hover {
  color: var(--text-secondary);
}

.view-toggle__btn--active {
  background: var(--accent-primary);
  color: #fff;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Database Table View
   ═══════════════════════════════════════════════════════════════════════════ */

.db-table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  overflow: hidden;
}

.db-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.db-table-scroll::-webkit-scrollbar {
  height: 4px;
}

.db-table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.db-table-scroll::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.db-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.db-table__th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  position: relative;
}

.db-table__th--sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-tertiary);
}

.db-table__th--sticky::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--glass-border);
}

.db-table__row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.db-table__row:hover {
  background: var(--bg-tertiary);
}

.db-table__row:active {
  background: var(--glass-highlight);
}

.db-table__td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.db-table__td--sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-secondary);
}

.db-table__row:hover .db-table__td--sticky {
  background: var(--bg-tertiary);
}

.db-table__td--sticky::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--glass-border);
}

.db-table__td--company {
  min-width: 160px;
}

.db-table__td--desc {
  min-width: 180px;
  max-width: 260px;
}

.db-table__company {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-table__logo {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
  overflow: hidden;
}

.db-table__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.db-table__name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.db-table__stage {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 3px;
  color: var(--text-secondary);
}

.db-table__text {
  color: var(--text-primary);
}

.db-table__desc {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 240px;
  font-size: 0.75rem;
}

.db-table__date {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.db-table__empty {
  color: var(--text-tertiary);
  opacity: 0.4;
}

.db-table__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
}

.db-table__count {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

.db-table__enriching {
  font-size: 0.625rem;
  color: var(--primary);
  margin-left: 8px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

.kanban {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Stage Tabs (horizontal scroll on mobile) */
.kanban-tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.kanban-tabs::-webkit-scrollbar {
  display: none;
}

.kanban-tab {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kanban-tab:active {
  transform: scale(0.98);
}

.kanban-tab--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.kanban-tab--active .kanban-tab__name,
.kanban-tab--active .kanban-tab__count {
  color: #fff;
}

.kanban-tab__name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.kanban-tab__count {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.kanban-tab--active .kanban-tab__count {
  background: rgba(255, 255, 255, 0.2);
}

/* Kanban Board (horizontal scroll) */
.kanban-board {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.kanban-board::-webkit-scrollbar {
  height: 4px;
}

.kanban-board::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 2px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

/* Kanban Column */
.kanban-column {
  flex: 0 0 280px;
  min-width: 280px;
  max-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  scroll-snap-align: start;
}

.kanban-column__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 1;
}

.kanban-column__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-column__count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

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

.kanban-column__loading {
  display: flex;
  justify-content: center;
  padding: var(--space-lg);
}

.kanban-column__empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  padding: var(--space-lg);
}

.kanban-column__load-more {
  width: 100%;
  padding: var(--space-sm);
  background: transparent;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-column__load-more:hover,
.kanban-column__load-more:active {
  background: var(--bg-secondary);
  border-style: solid;
}

/* Kanban Card */
.kanban-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-card:active {
  transform: scale(0.98);
}

.kanban-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.kanban-card__logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.kanban-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kanban-card__name {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card__desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
}

.kanban-card__tag {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--accent-secondary);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.kanban-card__date {
  font-size: 0.625rem;
  color: var(--text-tertiary);
}

.kanban-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
}

/* Loading spinner small variant */
.loading__spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Lists
   ═══════════════════════════════════════════════════════════════════════════ */

.list {
  list-style: none;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.list-item:hover {
  background: var(--glass-highlight);
}

.list-item__content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.list-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  overflow: hidden;
}

.list-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item__text {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.list-item__arrow {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-state__icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

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

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-md);
}

.loading__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Alerts / Messages
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  border: 1px solid;
}

.alert--error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-error);
}

.alert--success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--accent-success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Status Line & Section Elements
   ═══════════════════════════════════════════════════════════════════════════ */

.terminal-line {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.terminal-line::before {
  content: '•';
  color: var(--accent-primary);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
}

.section-title--clickable {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.section-title--clickable:hover,
.section-title--clickable:active {
  color: var(--text-primary);
}

.section-title__toggle {
  font-size: 0.625rem;
  transition: transform 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Timeline
   ═══════════════════════════════════════════════════════════════════════════ */

.timeline-section {
  margin-top: var(--space-md);
}

.timeline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.timeline-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.timeline {
  position: relative;
  padding-left: var(--space-lg);
}

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

.timeline-item {
  position: relative;
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
}

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

.timeline-item__icon {
  position: absolute;
  left: calc(-1 * var(--space-lg) - 2px);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: 50%;
  font-size: 0.75rem;
  z-index: 1;
}

.timeline-item__content {
  flex: 1;
  min-width: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.timeline-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.timeline-item__action {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.timeline-item__date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.timeline-item__user {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.timeline-item__detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Documents
   ═══════════════════════════════════════════════════════════════════════════ */

.documents-section {
  margin-top: var(--space-md);
}

.documents-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.documents-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.document-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.document-item:hover,
.document-item:active {
  background: var(--bg-secondary);
}

.document-item--folder {
  opacity: 0.7;
}

.document-item__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.document-item__info {
  flex: 1;
  min-width: 0;
}

.document-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-item__meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.document-item__download {
  color: var(--accent-primary);
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.document-item:hover .document-item__download,
.document-item:active .document-item__download {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tasks
   ═══════════════════════════════════════════════════════════════════════════ */

.section-title--with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title__add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.section-title__add-btn:hover,
.section-title__add-btn:active {
  transform: scale(1.1);
}

.task-form {
  margin-bottom: var(--space-md);
}

.task-form__row {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.task-form__date {
  flex: 1;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tasks-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.task-item--completed {
  opacity: 0.6;
}

.task-item__checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--glass-border);
  background: transparent;
  color: var(--accent-primary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.task-item__checkbox:hover {
  border-color: var(--accent-primary);
}

.task-item__checkbox--checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.task-item__content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.task-item__text {
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}

.task-item--completed .task-item__text {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-item__date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}

.task-item__delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.task-item__delete:hover,
.task-item__delete:active {
  opacity: 1;
  color: var(--accent-error);
  background: rgba(239, 68, 68, 0.1);
}

.task-item__edit {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Comments Section
   ═══════════════════════════════════════════════════════════════════════════ */

.comment-form {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.comment-form__textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.comment-form__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-sm);
  gap: var(--space-sm);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comment-item {
  padding: var(--space-md);
}

.comment-item__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.comment-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  flex-shrink: 0;
}

.comment-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-item__meta {
  flex: 1;
  min-width: 0;
}

.comment-item__author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-item__date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.comment-item__actions {
  display: flex;
  gap: var(--space-xs);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.comment-item:hover .comment-item__actions {
  opacity: 1;
}

.comment-item__action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.comment-item__action:hover,
.comment-item__action:active {
  background: var(--glass-card);
  color: var(--text-primary);
}

.comment-item__action--delete:hover,
.comment-item__action--delete:active {
  color: var(--accent-error);
  background: rgba(239, 68, 68, 0.1);
}

.comment-item__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-item__edit {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.comments-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Notes Section
   ═══════════════════════════════════════════════════════════════════════════ */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.note-card {
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.note-card:active {
  transform: scale(0.98);
}

.note-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.note-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.note-card__label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
}

.note-card__label--company {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.note-card__delete {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.note-card__delete:hover,
.note-card__delete:active {
  opacity: 1;
  color: var(--accent-error);
  background: rgba(239, 68, 68, 0.1);
}

.note-card__preview {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-card__meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.notes-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
}

.notes-empty__icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Note Editor (Full-Screen)
   ═══════════════════════════════════════════════════════════════════════════ */

.note-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-primary);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.note-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.note-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  padding-top: max(var(--space-md), env(safe-area-inset-top));
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-primary);
}

.note-editor__close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.note-editor__close:hover,
.note-editor__close:active {
  background: var(--glass-card);
  color: var(--text-primary);
}

.note-editor__status {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
}

.note-editor__saving {
  color: var(--text-tertiary);
}

.note-editor__saved {
  color: var(--accent-success);
}

.note-editor__unsaved {
  color: var(--accent-warning);
}

.note-editor__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 0;
}

.note-editor__title {
  width: 100%;
  padding: var(--space-md);
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

.note-editor__title::placeholder {
  color: var(--text-tertiary);
}

.note-editor__label-toggle {
  display: flex;
  gap: var(--space-xs);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.note-editor__label-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.note-editor__label-btn--active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.note-editor__body {
  flex: 1;
  padding: 0 var(--space-md);
  padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* EasyMDE Customization */
.note-editor__body .EasyMDEContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.note-editor__body .EasyMDEContainer .CodeMirror {
  flex: 1;
  border: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--glass-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  padding: var(--space-sm);
  height: auto !important;
  min-height: 200px !important;
}

.note-editor__body .EasyMDEContainer .CodeMirror-scroll {
  min-height: 200px;
}

.note-editor__body .EasyMDEContainer .CodeMirror-sizer {
  min-height: 180px !important;
}

.note-editor__body .EasyMDEContainer .CodeMirror-cursor {
  border-left-color: var(--text-primary);
}

.note-editor__body .EasyMDEContainer .CodeMirror-selected {
  background: rgba(var(--accent-primary-rgb), 0.2);
}

.note-editor__body .editor-toolbar {
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--glass-card);
  padding: var(--space-sm);
  opacity: 1;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.note-editor__body .editor-toolbar::before,
.note-editor__body .editor-toolbar::after {
  display: none;
}

.note-editor__body .editor-toolbar button {
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  margin: 0;
}

.note-editor__body .editor-toolbar button:hover,
.note-editor__body .editor-toolbar button.active {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
}

.note-editor__body .editor-toolbar i.separator {
  border-left-color: var(--glass-border);
}

.note-editor__body .editor-preview {
  background: var(--glass-card);
  color: var(--text-primary);
  padding: var(--space-md);
}

.note-editor__body .editor-preview pre {
  background: var(--bg-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.note-editor__body .editor-preview code {
  background: var(--bg-secondary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Note Editor Page View (Route-based)
   ═══════════════════════════════════════════════════════════════════════════ */

.note-editor-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.note-editor-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md);
  padding-top: max(var(--space-md), env(safe-area-inset-top));
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-primary);
}

.note-editor-header__back {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.note-editor-header__back:active {
  background: var(--bg-tertiary);
}

.note-editor-header__info {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.note-editor-header__company {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-editor-header__status {
  font-size: 0.75rem;
  margin-top: 2px;
}

.note-editor-header__status .status--saving {
  color: var(--text-tertiary);
}

.note-editor-header__status .status--saved {
  color: var(--accent-success);
}

.note-editor-header__status .status--unsaved {
  color: var(--accent-warning);
}

.note-editor-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
}

.note-editor-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: calc(60px + max(var(--space-md), env(safe-area-inset-top)));
  min-height: 0;
}

.note-editor-title {
  width: 100%;
  padding: var(--space-md);
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  flex-shrink: 0;
}

.note-editor-title::placeholder {
  color: var(--text-tertiary);
}

.note-editor-body {
  flex: 1;
  padding: 0 var(--space-md);
  padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

/* EasyMDE Customization for page view */
.note-editor-body .EasyMDEContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.note-editor-body .EasyMDEContainer .CodeMirror {
  flex: 1;
  border: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  padding: var(--space-sm);
  height: auto !important;
  min-height: 250px !important;
}

.note-editor-body .EasyMDEContainer .CodeMirror-scroll {
  min-height: 250px;
}

.note-editor-body .EasyMDEContainer .CodeMirror-cursor {
  border-left-color: var(--text-primary);
}

.note-editor-body .EasyMDEContainer .CodeMirror-selected {
  background: rgba(var(--accent-primary-rgb), 0.2);
}

.note-editor-body .editor-toolbar {
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-secondary);
  padding: var(--space-sm);
  opacity: 1;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.note-editor-body .editor-toolbar::before,
.note-editor-body .editor-toolbar::after {
  display: none;
}

.note-editor-body .editor-toolbar button {
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  margin: 0;
}

.note-editor-body .editor-toolbar button:hover,
.note-editor-body .editor-toolbar button.active {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
}

.note-editor-body .editor-toolbar i.separator {
  border-left-color: var(--glass-border);
}

.note-editor-body .editor-preview {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Transitions
   ═══════════════════════════════════════════════════════════════════════════ */

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-up-enter-active,
.slide-up-leave-active {
  transition: all 0.3s ease;
}

.slide-up-enter-from,
.slide-up-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbar
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   Company Profile
   ═══════════════════════════════════════════════════════════════════════════ */

.company-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.company-profile-header__logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.company-profile-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-profile-header__info {
  flex: 1;
  min-width: 0;
}

.company-profile-header__name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.company-profile-header__name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.company-profile-header__website {
  font-size: 0.875rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.company-profile-header__social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.social-icon:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.social-icon svg {
  width: 16px;
  height: 16px;
}

/* Stage Badge */
.stage-badge-wrapper {
  position: relative;
  flex-shrink: 0;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-primary), #1e5a57);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.stage-badge:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stage-badge:active:not(:disabled) {
  transform: translateY(0);
}

.stage-badge:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.stage-badge__name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-badge__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  opacity: 0.8;
}

.stage-badge__chevron--open {
  transform: rotate(180deg);
}

.stage-badge--loading {
  position: relative;
  color: transparent;
}

.stage-badge--loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.stage-move-error {
  font-size: 0.8125rem;
  color: var(--accent-error);
  margin-top: var(--space-sm);
}

/* Sticky Save Bar */
.sticky-save-bar {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg-primary);
  padding: var(--space-md) 0;
  margin: 0 calc(-1 * var(--space-md));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--glass-border);
}

/* Activity Tabs */
.activity-tabs-container {
  margin-top: var(--space-xl);
}

.activity-tabs {
  display: flex;
  gap: 2px;
  background: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.activity-tabs::-webkit-scrollbar {
  display: none;
}

.activity-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xs);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.activity-tab--active {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.activity-tab__label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 600;
}

.activity-tab--active .activity-tab__count {
  background: var(--accent-primary);
}

.activity-content {
  margin-top: var(--space-md);
}

.tab-panel {
  animation: fadeIn 0.2s ease;
}

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

.tab-panel__header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

.tab-panel__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.tab-panel__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.view-all-btn {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  background: transparent;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-all-btn:hover {
  background: rgba(var(--accent-primary-rgb), 0.05);
  border-style: solid;
}

/* Field List */
.field-list {
  /* Container for field items */
}

.field-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--glass-border);
}

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

.field-item__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  max-width: 40%;
}

.field-item__value {
  font-size: 0.875rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.field-item__value--link a {
  color: var(--accent-primary);
  text-decoration: none;
}

.field-item__value--link a:hover {
  text-decoration: underline;
}

.field-item__link {
  color: var(--accent-primary);
  text-decoration: none;
}

.field-item__link:hover,
.field-item__link:active {
  text-decoration: underline;
}

.field-item__input {
  flex: 1;
  min-width: 0;
}

.field-item__input .form-input {
  font-size: 0.875rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
}

.field-item__input textarea.form-input {
  resize: vertical;
  min-height: 60px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-auto { margin-top: auto; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════════════════════════════════════
   Floating Action Button (FAB)
   ═══════════════════════════════════════════════════════════════════════════ */

.fab {
  position: fixed;
  bottom: calc(var(--space-xl) + var(--safe-bottom));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(var(--accent-primary-rgb), 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  z-index: 50;
}

.fab:hover {
  background: var(--accent-secondary);
  transform: scale(1.05);
}

.fab:active {
  transform: scale(0.95);
}

.fab__icon {
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modal / Popup
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: var(--space-md);
  padding-bottom: calc(var(--space-md) + var(--safe-bottom));
}

.modal-overlay--fade-enter-active,
.modal-overlay--fade-leave-active {
  transition: opacity 0.25s ease;
}

.modal-overlay--fade-enter-from,
.modal-overlay--fade-leave-to {
  opacity: 0;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.25s ease;
}

.modal-overlay--fade-enter-from .modal,
.modal-overlay--fade-leave-to .modal {
  transform: translateY(20px);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--glass-border);
}

.modal__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
}

.modal__search {
  position: relative;
  margin-bottom: var(--space-md);
}

.modal__search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  padding-left: calc(var(--space-md) + 24px);
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.modal__search-input::placeholder {
  color: var(--text-tertiary);
}

.modal__search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

.modal__search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  pointer-events: none;
}

/* Search Results */
.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.search-results__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.search-results__empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.search-results__empty-create {
  text-align: center;
  padding: var(--space-lg);
}

.search-results__empty-text {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.search-results__create-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-results__create-btn:hover,
.search-results__create-btn:active {
  opacity: 0.9;
  transform: scale(1.02);
}

.search-results__create-icon {
  font-size: 1.125rem;
  font-weight: 500;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  border-color: var(--accent-primary);
  background: var(--glass-bg);
}

.search-result-item__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.search-result-item__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-item__info {
  flex: 1;
  min-width: 0;
}

.search-result-item__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.search-result-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item__tag {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.search-result-item__desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-item__meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-item__add {
  color: var(--accent-primary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.search-result-item__arrow {
  color: var(--text-tertiary);
  font-size: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.search-result-item:hover .search-result-item__arrow,
.search-result-item:active .search-result-item__arrow {
  color: var(--accent-primary);
  transform: translateX(2px);
}

/* Modal Back Button */
.modal__back {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: var(--space-sm);
}

.modal__back:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

/* Stage Selection Modal - top positioned variant */
.modal-overlay--centered {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  align-items: flex-start;
  padding-top: 80px;
  z-index: 9999;
}

/* Stage Selection List */
.stage-select-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-select-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  width: 100%;
}

.stage-select-item:hover:not(:disabled) {
  background: var(--glass-highlight);
}

.stage-select-item:disabled {
  cursor: default;
}

.stage-select-item--current {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.stage-select-item__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.stage-select-item:hover:not(:disabled) .stage-select-item__dot {
  background: var(--accent-primary);
  transform: scale(1.1);
}

.stage-select-item__dot--current {
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.2);
}

.stage-select-item__name {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.stage-select-item--current .stage-select-item__name {
  color: var(--accent-primary);
}

.stage-select-item__badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Selected Company Preview */
.selected-company-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.selected-company-preview__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.selected-company-preview__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-company-preview__info {
  flex: 1;
  min-width: 0;
}

.selected-company-preview__name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.selected-company-preview__domain {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Pipeline List */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pipeline-list__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.pipeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pipeline-item:hover {
  border-color: var(--accent-primary);
  background: var(--glass-bg);
}

.pipeline-item__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.pipeline-item__count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Offline Indicator
   ═══════════════════════════════════════════════════════════════════════════ */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--accent-warning);
  color: #000;
  padding: 6px var(--space-md);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.offline-banner--visible {
  transform: translateY(0);
}

.offline-banner__text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.offline-banner__icon {
  font-size: 0.875rem;
}

/* Update Banner */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--accent-primary), #2d6a4f);
  color: #fff;
  padding: 10px var(--space-md);
  padding-top: calc(10px + var(--safe-top));
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-md);
}

.update-banner--visible {
  transform: translateY(0);
}

.update-banner__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.update-banner__text {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.update-banner__btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.update-banner__btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.update-banner__btn:active {
  transform: scale(0.98);
}

/* Cached data indicator */
.cached-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  color: var(--text-tertiary);
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.cached-indicator__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warning);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Install Prompt
   ═══════════════════════════════════════════════════════════════════════════ */

.install-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.install-prompt {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out;
}

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

/* Intro Screen */
.install-prompt__intro {
  padding: var(--space-xl);
  text-align: center;
}

.install-prompt__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  background: linear-gradient(135deg, var(--accent-primary), #2d6a4f);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(23, 64, 62, 0.3);
}

.install-prompt__icon img {
  width: 40px;
  height: auto;
  filter: brightness(0) invert(1);
}

.install-prompt__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.install-prompt__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-xl);
  line-height: 1.5;
}

/* Features List */
.install-prompt__features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  text-align: left;
}

.install-prompt__feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.install-prompt__feature-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: rgba(var(--accent-primary-rgb), 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.install-prompt__feature-icon svg {
  width: 20px;
  height: 20px;
}

.install-prompt__feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.install-prompt__feature-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.install-prompt__feature-text span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Actions */
.install-prompt__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.install-prompt__btn {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.install-prompt__btn--primary {
  background: var(--accent-primary);
  color: white;
}

.install-prompt__btn--primary:hover {
  background: #1a4a47;
}

.install-prompt__btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.install-prompt__btn--secondary {
  background: transparent;
  color: var(--text-secondary);
}

.install-prompt__btn--secondary:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.install-prompt__btn--text {
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  padding: var(--space-sm);
}

.install-prompt__btn--text:hover {
  color: var(--text-secondary);
}

.install-prompt__btn--large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

/* Install Screen */
.install-prompt__install {
  padding: var(--space-xl);
  position: relative;
}

.install-prompt__back {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.install-prompt__back:hover {
  background: var(--glass-border);
  color: var(--text-primary);
}

.install-prompt__back svg {
  width: 18px;
  height: 18px;
}

.install-prompt__method {
  text-align: center;
  padding-top: var(--space-lg);
}

.install-prompt__method-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  background: rgba(var(--accent-primary-rgb), 0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.install-prompt__method-icon svg {
  width: 32px;
  height: 32px;
}

.install-prompt__method h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
}

.install-prompt__method p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg);
  line-height: 1.5;
}

.install-prompt__error {
  color: var(--accent-error);
  font-size: 0.8125rem;
  margin-top: var(--space-sm);
}

/* iOS Steps */
.install-prompt__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
  margin-bottom: var(--space-xl);
}

.install-prompt__step {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.install-prompt__step-number {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--accent-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.install-prompt__step span {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.install-prompt__step strong {
  color: var(--accent-primary);
}

.install-prompt__share-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
  margin-left: auto;
}

/* Dark theme adjustments */
.dark-theme .install-prompt__icon {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dark-theme .install-prompt__feature-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-secondary);
}

.dark-theme .install-prompt__method-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-secondary);
}

.dark-theme .install-prompt__step-number {
  background: var(--accent-secondary);
}

.dark-theme .install-prompt__step strong {
  color: var(--accent-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Skeleton Screens
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--glass-border) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Skeleton Card (Company card placeholder) */
.skeleton-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--glass-border);
}

.skeleton-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.skeleton-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
}

.skeleton-card__title {
  flex: 1;
}

.skeleton-card__title-line {
  height: 14px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
}

.skeleton-card__title-line:first-child {
  width: 70%;
}

.skeleton-card__title-line:last-child {
  width: 50%;
  height: 10px;
}

.skeleton-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.skeleton-card__line {
  height: 12px;
  border-radius: var(--radius-sm);
}

.skeleton-card__line:nth-child(1) { width: 100%; }
.skeleton-card__line:nth-child(2) { width: 80%; }
.skeleton-card__line:nth-child(3) { width: 60%; }

/* Skeleton Stage Header */
.skeleton-stage {
  min-width: 300px;
  max-width: 300px;
  flex-shrink: 0;
}

.skeleton-stage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--glass-border);
  border-bottom: none;
}

.skeleton-stage__title {
  height: 16px;
  width: 120px;
  border-radius: var(--radius-sm);
}

.skeleton-stage__count {
  height: 20px;
  width: 30px;
  border-radius: var(--radius-full);
}

.skeleton-stage__body {
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  min-height: 200px;
}

/* Kanban skeleton container */
.kanban-skeleton {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Dark theme skeleton */
.dark-theme .skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
}
