/* MediqCode — Landing Page + CRM shared styles */
:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --fg: #1A1A1A;
  --fg-muted: #6B6B6B;
  --fg-subtle: #A0A0A0;
  --accent: #0D7377;
  --accent-dark: #095457;
  --amber: #F5A623;
  --amber-bg: #FFF3E0;
  --red: #C62828;
  --green: #2E7D32;
  --border: #E8E4DF;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.15;
  font-weight: 700;
}

/* NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 48px;
  background: rgba(250, 249, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--fg);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.nav-dot { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--fg); }
.nav-links .btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
}
.nav-links .btn-primary:hover { background: var(--accent-dark); }

/* HERO */
.hero {
  padding: 140px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(13, 115, 119, 0.08);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-headline {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 20px;
  letter-spacing: -2px;
}
.hero-sub {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.7;
  max-width: 460px;
}

/* CODE WINDOW */
.code-window {
  background: #1C1C1E;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 32px 64px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.08);
}
.code-bar {
  background: #2C2C2E;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.code-dot.red { background: #FF5F57; }
.code-dot.yellow { background: #FEBC2E; }
.code-dot.green { background: #28C840; }
.code-title {
  color: #8E8E93;
  font-size: 12px;
  margin-left: 12px;
  font-family: monospace;
}
pre.code-content {
  padding: 20px 24px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #D1D1D6;
  overflow-x: auto;
}
pre.code-content .kw  { color: #FF4479; }
pre.code-content .fn  { color: #64D2FF; }
pre.code-content .str  { color: #28C840; }
pre.code-content .cm  { color: #6B6B6B; }

/* SECTIONS */
.section {
  padding: 80px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* GRID */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.card-sub {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* CTA */
.cta-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 64px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

/* =========================================
   CRM DASHBOARD
   ========================================= */

.crm-body {
  padding-top: 80px;
  min-height: 100vh;
}

.crm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px;
}

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

.crm-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.crm-sub {
  font-size: 14px;
  color: var(--fg-muted);
}

/* Pipeline Overview */
.pipeline-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stage-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.1);
}

.stage-card.active {
  border-color: var(--accent);
  background: rgba(13, 115, 119, 0.03);
}

.stage-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.stage-count {
  font-size: 36px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--fg);
  line-height: 1;
}

.stage-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-lead       { background: #F0F0F0; color: #555; }
.badge-demo_scheduled { background: #E3F2FD; color: #1565C0; }
.badge-proposal   { background: var(--amber-bg); color: #E65100; }
.badge-won        { background: #E8F5E9; color: var(--green); }
.badge-lost       { background: #FFEBEE; color: var(--red); }

/* Content area */
.crm-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

/* Lead table */
.lead-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.table-title {
  font-size: 16px;
  font-weight: 700;
}

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

.lead-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-subtle);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.lead-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.lead-table tr:last-child td { border-bottom: none; }

.lead-table tr:hover td { background: rgba(13, 115, 119, 0.03); }

.lead-name {
  font-weight: 600;
  color: var(--fg);
}

.lead-company {
  font-size: 13px;
  color: var(--fg-muted);
}

.lead-email {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

.lead-email:hover { text-decoration: underline; }

.stage-select {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
  transition: border-color 0.15s;
}

.stage-select:focus { outline: none; border-color: var(--accent); }

.stage-select.lead         { color: #555; }
.stage-select.demo_scheduled { color: #1565C0; }
.stage-select.proposal     { color: #E65100; }
.stage-select.won         { color: var(--green); }
.stage-select.lost         { color: var(--red); }

.lead-actions {
  display: flex;
  gap: 8px;
}

.btn-ghost {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg-muted);
  transition: all 0.15s;
}

.btn-ghost:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
}

.btn-ghost.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--fg-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p { font-size: 15px; }

/* Sidebar */
.crm-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.add-lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-title-sm {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 60px; }

.btn-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-submit:hover { background: var(--accent-dark); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Recent activity */
.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.activity-list { list-style: none; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

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

.dot-lead         { background: #9E9E9E; }
.dot-demo_scheduled { background: #1565C0; }
.dot-proposal     { background: var(--amber); }
.dot-won          { background: var(--green); }
.dot-lost         { background: var(--red); }

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

.activity-time {
  font-size: 11px;
  color: var(--fg-subtle);
  margin-top: 2px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1A1A1A;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: toastIn 0.2s ease;
}

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

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}