/* ═══════════════════════════════════════════════════
   InboxForge Design System — Wine Red on Warm Cream
   ═══════════════════════════════════════════════════ */

:root {
  /* Wine Red Scale */
  --wine-950: #1a0008;
  --wine-900: #3b0015;
  --wine-800: #5e0022;
  --wine-700: #850031;
  --wine-600: #a8003d;
  --wine-500: #c8184f;
  --wine-400: #e03f6a;
  --wine-300: #f07090;
  --wine-200: #f8aab8;
  --wine-100: #fcd9e0;
  --wine-050: #fff0f3;

  /* Cream Surfaces */
  --cream-bg: #fdf7f0;
  --cream-card: #fffbf7;
  --cream-subtle: #f5ede4;
  --cream-deep: #ecddd0;

  /* Semantic colours */
  --color-text-primary: #1a0008;
  --color-text-secondary: #6b4a52;
  --color-text-muted: #a08088;
  --color-success: #1a7f64;
  --color-warning: #b45309;
  --color-error: #be123c;
  --color-info: #1d4ed8;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #a8003d 0%, #c8184f 50%, #e03f6a 100%);
  --grad-sidebar: linear-gradient(180deg, #3b0015 0%, #5e0022 40%, #850031 100%);
  --grad-hero: linear-gradient(135deg, #850031 0%, #a8003d 60%, #c8184f 100%);
  --grad-icon-a: linear-gradient(135deg, #c8184f, #f07090);
  --grad-icon-b: linear-gradient(135deg, #850031, #c8184f);
  --grad-icon-c: linear-gradient(135deg, #1a7f64, #34d399);
  --grad-icon-d: linear-gradient(135deg, #1d4ed8, #60a5fa);

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

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

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(168, 0, 61, 0.08), 0 1px 2px rgba(168, 0, 61, 0.05);
  --shadow-md: 0 4px 12px rgba(168, 0, 61, 0.1), 0 2px 4px rgba(168, 0, 61, 0.06);
  --shadow-lg: 0 10px 30px rgba(168, 0, 61, 0.14), 0 4px 8px rgba(168, 0, 61, 0.08);
  --shadow-green: 0 4px 16px rgba(168, 0, 61, 0.3);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --focus-ring: 0 0 0 3px rgba(200, 24, 79, 0.35);

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* Dark theme */
[data-theme='dark'] {
  --cream-bg: #0e0008;
  --cream-card: #18000c;
  --cream-subtle: #260010;
  --cream-deep: #360018;
  --color-text-primary: #fcd9e0;
  --color-text-secondary: #f07090;
  --color-text-muted: #a0506a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ── Reset ────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  background: var(--cream-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input,
textarea,
select {
  font-family: inherit;
}

/* ── Layout ───────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--grad-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.25s var(--ease);
}
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#topbar {
  height: var(--topbar-h);
  background: var(--cream-card);
  border-bottom: 1px solid var(--cream-deep);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
#content {
  padding: var(--space-xl);
  flex: 1;
}

/* ── Sidebar Logo ─────────────────────────────────── */
.sidebar-logo {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-icon-a);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* ── Nav ─────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
}
.nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  padding: var(--space-md) var(--space-sm) var(--space-xs);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav-item[aria-current='page'],
.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--wine-300);
}
.nav-item .nav-icon {
  width: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-badge {
  margin-left: auto;
  background: var(--wine-400);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

/* ── Sidebar Footer ──────────────────────────────── */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-icon-a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}
.user-email {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Topbar ──────────────────────────────────────── */
#menuToggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-sm);
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.sync-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.sync-btn:hover {
  opacity: 0.85;
}
.theme-toggle {
  background: none;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  font-size: 1rem;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--cream-card);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* ── Stat Cards ──────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.stat-card {
  background: var(--cream-card);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-icon.total {
  background: var(--grad-icon-a);
}
.stat-icon.scheduled {
  background: var(--grad-icon-b);
}
.stat-icon.analyzed {
  background: var(--grad-icon-c);
}
.stat-icon.hot {
  background: var(--grad-icon-d);
}
.stat-icon.deals {
  background: linear-gradient(135deg, #b45309, #f59e0b);
}
.stat-icon.followups {
  background: linear-gradient(135deg, #6d28d9, #a78bfa);
}
.stat-icon.ai {
  background: linear-gradient(135deg, #0891b2, #67e8f9);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}
.stat-delta {
  font-size: 0.7rem;
  margin-top: var(--space-xs);
}
.stat-delta.up {
  color: var(--color-success);
}
.stat-delta.down {
  color: var(--color-error);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all 0.15s var(--ease);
  cursor: pointer;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.88;
  box-shadow: var(--shadow-green);
}
.btn-secondary {
  background: var(--cream-subtle);
  color: var(--color-text-primary);
  border: 1px solid var(--cream-deep);
}
.btn-secondary:hover {
  background: var(--cream-deep);
}
.btn-danger {
  background: #be123c;
  color: #fff;
}
.btn-danger:hover {
  opacity: 0.85;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--cream-deep);
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--cream-subtle);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}
.btn-tiny {
  padding: 2px 8px;
  font-size: 0.72rem;
}

/* ── Pills ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}
.pill-active {
  background: #dcfce7;
  color: #166534;
}
.pill-inactive {
  background: var(--cream-subtle);
  color: var(--color-text-muted);
}
.pill-hot {
  background: #fff1f2;
  color: #9f1239;
}
.pill-warn {
  background: #fef9c3;
  color: #854d0e;
}
.pill-info {
  background: #eff6ff;
  color: #1e40af;
}
.pill-success {
  background: #f0fdf4;
  color: #166534;
}
.pill-suspended {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Forms ───────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text-secondary);
}
.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream-card);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--wine-500);
  box-shadow: var(--focus-ring);
}
textarea.form-input {
  resize: vertical;
  min-height: 100px;
}
select.form-input {
  cursor: pointer;
}

/* ── Rule Builder (plain-language automation rules) ─ */
.rule-template-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.rule-template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--cream-deep);
  border-radius: 99px;
  background: var(--cream-subtle);
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}
.rule-template-chip:hover {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
}
.rule-builder-block {
  background: var(--cream-subtle);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.rule-builder-heading {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}
.rule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  background: var(--cream-card);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.rule-row .form-input {
  width: auto;
  flex: 1 1 160px;
  margin-bottom: 0;
}
.rule-row textarea.form-input {
  min-height: 60px;
  flex-basis: 100%;
}
.rule-row-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-deep);
  background: transparent;
  color: var(--color-error);
  cursor: pointer;
}
.rule-row-remove:hover {
  background: var(--color-error);
  color: #fff;
  border-color: transparent;
}
.rule-row-connector {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: -2px 0 var(--space-xs);
}
.rule-plain-summary {
  background: var(--cream-subtle);
  border-left: 3px solid var(--wine-500);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ── Table ───────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-deep);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th {
  background: var(--cream-subtle);
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
td {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--cream-deep);
  vertical-align: middle;
}
tr:hover td {
  background: var(--cream-subtle);
}

/* ── Modal ───────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 0, 8, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show {
  display: flex;
}
.modal {
  background: var(--cream-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.modal-close:hover {
  background: var(--cream-subtle);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Toast ───────────────────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s var(--ease);
  max-width: 360px;
}
.toast-success {
  background: var(--color-success);
}
.toast-error {
  background: var(--color-error);
}
.toast-info {
  background: var(--color-info);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Skeleton ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--cream-subtle) 25%,
    var(--cream-deep) 50%,
    var(--cream-subtle) 75%
  );
  background-size: 200%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from {
    background-position: 200%;
  }
  to {
    background-position: -200%;
  }
}

/* ── Global Loader ───────────────────────────────── */
#globalLoader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  background: var(--grad-primary);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition:
    transform 0.2s var(--ease),
    opacity 0.3s var(--ease);
}
#globalLoader.loading {
  transform: scaleX(0.7);
  opacity: 1;
  transition: transform 2s cubic-bezier(0, 0.5, 0.5, 1);
}
#globalLoader.done {
  transform: scaleX(1);
  opacity: 0;
}

/* ── Section ─────────────────────────────────────── */
.section {
  display: none;
  opacity: 0;
}
.section.active {
  display: block;
  animation: fadeInSlide 0.25s var(--ease) forwards;
}
@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}
.page-sub {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-xl);
}

/* ── Chart container ─────────────────────────────── */
.chart-wrap {
  position: relative;
}
canvas {
  max-width: 100%;
}

/* ── Email List ──────────────────────────────────── */
.email-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.email-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.email-item:hover {
  background: var(--cream-subtle);
  border-color: var(--cream-deep);
}
.email-item.unread .email-subject {
  font-weight: 700;
}
.email-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-icon-a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.email-meta {
  flex: 1;
  min-width: 0;
}
.email-from {
  font-weight: 600;
  font-size: 0.875rem;
}
.email-subject {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-snippet {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Kanban ──────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
}
.kanban-col {
  min-width: 240px;
  flex-shrink: 0;
  background: var(--cream-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  font-weight: 700;
  font-size: 0.85rem;
}
.kanban-count {
  background: var(--cream-deep);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.72rem;
}
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 80px;
}
.kanban-card {
  background: var(--cream-card);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
}
.kanban-card.dragging {
  opacity: 0.5;
}
.kanban-card-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--space-xs);
}
.kanban-card-company {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.kanban-card-value {
  font-size: 0.8rem;
  color: var(--wine-600);
  font-weight: 700;
  margin-top: var(--space-xs);
}

/* ── Grid ────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

/* ── Overlay (mobile) ────────────────────────────── */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* ── Calendar ────────────────────────────────────── */
.cal-event {
  background: var(--wine-050);
  border-left: 3px solid var(--wine-500);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
}
.cal-event-title {
  font-weight: 600;
  font-size: 0.875rem;
}
.cal-event-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.cal-event-meet {
  font-size: 0.75rem;
  color: var(--color-info);
}

/* ── Search bar ──────────────────────────────────── */
.search-wrap {
  position: relative;
}
.search-wrap input {
  padding-left: 36px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: none;
  }
  #main {
    margin-left: 0;
  }
  #menuToggle {
    display: flex;
  }
  #overlay.open {
    display: block;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  #content {
    padding: var(--space-md);
  }
}

/* ── Misc utils ───────────────────────────────────── */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mb-md {
  margin-bottom: var(--space-md);
}
.text-muted {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}
.text-sm {
  font-size: 0.8rem;
}
.fw-700 {
  font-weight: 700;
}
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w-full {
  width: 100%;
}
hr.divider {
  border: none;
  border-top: 1px solid var(--cream-deep);
  margin: var(--space-lg) 0;
}

/* ── Login page ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--cream-bg);
}
.login-hero {
  flex: 1;
  background: var(--grad-hero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: #fff;
}
.login-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}
.login-panel {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}
.google-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  border: 2px solid var(--cream-deep);
  border-radius: var(--radius-lg);
  background: var(--cream-card);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all 0.2s;
  color: var(--color-text-primary);
}
.google-btn:hover {
  border-color: var(--wine-400);
  box-shadow: var(--shadow-md);
}
@media (max-width: 640px) {
  .login-hero {
    display: none;
  }
  .login-panel {
    width: 100%;
  }
}

/* ── Inbox filter tabs ───────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.filter-tab {
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--cream-deep);
  background: var(--cream-card);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--color-text-secondary);
}
.filter-tab:hover {
  border-color: var(--wine-400);
  color: var(--wine-600);
}
.filter-tab.active {
  background: var(--wine-500);
  border-color: var(--wine-500);
  color: #fff;
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--color-text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}
.empty-state h3 {
  font-family: var(--font-display);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

/* ── Progress bar ────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--cream-deep);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 99px;
  transition: width 0.3s var(--ease);
}

/* ── Score badge ─────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.score-high {
  background: #dcfce7;
  color: #166534;
}
.score-mid {
  background: #fef9c3;
  color: #854d0e;
}
.score-low {
  background: var(--cream-subtle);
  color: var(--color-text-muted);
}
