/* ── Dafthunk Design System Theme ──────────────────────────────────── */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --color-black: #0f172a;
  --color-black-hover: #1e293b;
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-blue: #2563eb;
  --color-purple: #7c3aed;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-page);
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header Bar */
.dafthunk-header {
  width: 100%;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.brand-icon {
  font-size: 22px;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-black);
}

.pill-badge {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
}

.auth-badge {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-item {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.nav-item:hover, .nav-item.active {
  color: var(--color-black);
}

/* Hero Section */
/* Queue Mode Switcher Tabs */
.queue-tab-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 16px;
}

.queue-tab {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.queue-tab:hover {
  color: var(--color-black);
  border-color: #cbd5e1;
}

.queue-tab.active {
  background: var(--color-black);
  color: #ffffff;
  border-color: var(--color-black);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.link-btn.call-big {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.link-btn.call-big:hover {
  background: #d1fae5;
}

.hero-badge-row {
  margin-bottom: 12px;
}

.hero-badge {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.hero-title {
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -1.2px;
  line-height: 1.15;
  color: var(--color-black);
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 24px;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 8px 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-black);
}

.stat-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tinder Swipe Area */
.swipe-container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px 40px;
}

.card-stack {
  width: 100%;
  height: 600px;
  position: relative;
}

/* Dafthunk Styled Tinder Card */
.tinder-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: var(--shadow-card);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  overflow: hidden;
}

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

.card-header {
  margin-bottom: 6px;
}

.business-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-black);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  color: #334155;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}

.tag.tag-warning {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  font-weight: 600;
}

.tag.tag-good {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
  font-weight: 600;
}

.flaws-container {
  margin: 6px 0;
}

.flaws-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.flaws-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.flaw-pill {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
}

.links-row {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.link-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--border-light);
  background: #f8fafc;
  color: #334155;
  transition: background 0.2s;
}

.link-btn:hover {
  background: #e2e8f0;
}

.link-btn.fb {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.pitch-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pitch-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.pitch-text {
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
  overflow-y: visible;
}

/* Stamps */
.stamp {
  position: absolute;
  top: 24px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

.stamp.approve {
  right: 24px;
  border: 3px solid var(--color-green);
  color: var(--color-green);
  transform: rotate(12deg);
}

.stamp.reject {
  left: 24px;
  border: 3px solid var(--color-red);
  color: var(--color-red);
  transform: rotate(-12deg);
}

/* Control Buttons */
.swipe-controls {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

.ctrl-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--color-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.ctrl-btn span { font-size: 20px; }
.ctrl-btn label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.ctrl-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.ctrl-btn.approve:hover { background: #ecfdf5; border-color: var(--color-green); color: var(--color-green); }
.ctrl-btn.discard:hover { background: #fef2f2; border-color: var(--color-red); color: var(--color-red); }
.ctrl-btn.regenerate:hover { background: #f5f3ff; border-color: var(--color-purple); color: var(--color-purple); }
.ctrl-btn.edit:hover { background: #eff6ff; border-color: var(--color-blue); color: var(--color-blue); }

/* Buttons */
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-black { background: var(--color-black); color: #ffffff; }
.btn-black:hover { background: var(--color-black-hover); }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-muted); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* Keyboard Hints */
.keyboard-hints {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

kbd {
  background: #e2e8f0;
  color: #334155;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  padding: 26px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

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

.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); }

.modal-body textarea {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  margin-top: 8px;
  background: #f8fafc;
  resize: vertical;
  color: #334155;
}

.char-counter { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 4px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Auth Lock Screen Overlay */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.logo-text { font-size: 20px; font-weight: 700; color: var(--color-black); }
.auth-card h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.auth-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

.auth-card input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 14px;
  text-align: center;
}

.auth-error {
  color: var(--color-red);
  font-size: 12px;
  margin-bottom: 10px;
}

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

.toast {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s ease-out;
}

.toast-error { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.toast-success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }

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

/* ─────────────────────────────────────────────────────────────
   CLIENT CRM KANBAN BOARD STYLES (Matching User Screenshot)
   ───────────────────────────────────────────────────────────── */

.crm-view {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.crm-top-banner {
  background: #eef2f6;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.crm-banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.crm-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.crm-stat-title {
  color: #1e293b;
  font-weight: 600;
}

.crm-stat-count {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.crm-stat-change {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.crm-stat-change.neg {
  color: #dc2626;
  background: #fef2f2;
}

.crm-stat-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
}

/* Kanban Board Layout */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.kanban-col {
  flex: 1;
  min-width: 250px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.kanban-col-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
}

.kanban-col-opts {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.kanban-col-opts:hover {
  background: #e2e8f0;
  color: #334155;
}

.kanban-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

/* Individual Client Card in Kanban */
.kanban-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  cursor: grab;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.kanban-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kanban-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.kanban-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}

.kanban-fb-badge {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 16px;
  height: 16px;
  background: #1877f2;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 2px solid #ffffff;
}

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

.kanban-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.kanban-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.crm-tag {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.crm-tag.payee {
  background: #f1f5f9;
  color: #334155;
}

.crm-tag.inactif {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.crm-tag.coldcall {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.kanban-actions-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.kanban-actions-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Context Stage Switcher Dropdown */
.stage-selector {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-select {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

/* Empty State */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state h2 { font-size: 22px; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 13px; max-width: 320px; margin: 0 auto 16px; }

/* Toast */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 210; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #ffffff; padding: 10px 16px; border-radius: 8px; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.hidden { display: none !important; }
