/* InLinked — shared app styles */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --brand: #0A66C2;
  --brand-dark: #004182;
  --surface: #F3F2EF;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
}

/* ── Nav ─── */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
  background: #EEF2FF;
  color: var(--brand);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
}

/* ── Page layout ─── */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { color: var(--muted); font-size: .9rem; margin: 0 0 28px; }

/* ── Cards ─── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card-body { padding: 24px; }

/* ── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-li {
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 10px;
}

/* ── Stats grid ─── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { padding: 20px 24px; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); font-size: .8rem; margin-top: 4px; }

/* ── Warm-path cards ─── */
.warm-paths-grid { display: grid; gap: 20px; }
.warm-card { padding: 0; overflow: hidden; }
.warm-card-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.company-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}
.company-info h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.company-info p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.warm-card-body { padding: 16px 24px 20px; }
.chain {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chain-node {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  min-width: 72px;
}
.chain-node .node-name { font-size: .78rem; font-weight: 600; }
.chain-node .node-role { font-size: .72rem; color: var(--muted); }
.chain-arrow {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 2px;
  padding-bottom: 10px;
}
.warm-card-actions {
  display: flex; gap: 10px; margin-top: 12px;
}
.copy-btn { position: relative; }
.copy-btn.copied::after {
  content: 'Copied!';
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff;
  font-size: .72rem; padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
}

/* ── Import page ─── */
.import-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafafa;
}
.import-zone.dragover { border-color: var(--brand); background: #EEF7FF; }
.import-zone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.import-zone h3 { margin: 0 0 6px; font-size: 1.05rem; }
.import-zone p { margin: 0; color: var(--muted); font-size: .875rem; }
.import-result { margin-top: 20px; padding: 14px 20px; border-radius: 8px; font-weight: 500; }
.import-result.success { background: #ECFDF5; color: #065F46; border: 1px solid #6EE7B7; }
.import-result.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 12px; overflow: hidden; display: none; }
.progress-fill { height: 100%; background: var(--brand); width: 0%; transition: width .3s; }

/* ── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-svg { margin: 0 auto 20px; display: block; }
.empty-state h3 { font-size: 1.1rem; margin: 0 0 6px; }
.empty-state p { color: var(--muted); font-size: .875rem; margin: 0 0 20px; }

/* ── App Nav (authenticated) ─── */
.app-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.app-nav-logo em { font-style: normal; }
.app-nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
}
.app-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.app-nav-link:hover, .app-nav-link.active {
  background: #EEF2FF;
  color: var(--brand);
}
.app-nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.app-nav-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  flex-shrink: 0;
}
.app-nav-avatar-img {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.app-nav-name {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}
.app-nav-logout {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.app-nav-logout:hover { border-color: var(--brand); color: var(--brand); }

/* ── Import wizard ─── */

/* Step stepper */
.import-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 4px;
}
.import-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s;
}
.import-step .step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.import-step.active { color: var(--brand); }
.import-step.active .step-num { background: var(--brand); color: #fff; }
.import-step.done { color: #059669; }
.import-step.done .step-num { background: #059669; color: #fff; }
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  min-width: 24px;
}

/* Step panels (show/hide) */
.import-panel { display: none; }
.import-panel.active { display: block; }

/* Walkthrough card */
.import-walkthrough { max-width: 680px; }
.walkthrough-icon { font-size: 2.2rem; margin-bottom: 12px; }
.import-walkthrough h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; }
.walkthrough-sub { color: var(--muted); font-size: .9rem; margin: 0 0 28px; }
.walkthrough-steps {
  margin: 0 0 24px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.walkthrough-steps li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 40px;
  position: relative;
}
.walkthrough-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #EEF7FF;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.walkthrough-steps li strong { font-weight: 600; font-size: .92rem; }
.walkthrough-link {
  color: var(--brand);
  font-size: .82rem;
  text-decoration: none;
}
.walkthrough-link:hover { text-decoration: underline; }
.walkthrough-note {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}
.walkthrough-note code {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, monospace;
  font-size: .8rem;
  color: var(--text);
}
.walkthrough-tip {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .85rem;
  margin-bottom: 24px;
  color: #92400E;
}
.tip-badge {
  background: #F59E0B;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.walkthrough-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* File error */
.import-file-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  font-size: .875rem;
}

/* Skeleton loader */
.parsing-skeleton { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-bar {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
.skeleton-bar.w-60 { width: 60%; }
.skeleton-bar.w-40 { width: 40%; }
.skeleton-bar.w-80 { width: 80%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Preview step */
.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.preview-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ECFDF5;
  border: 1px solid #6EE7B7;
  color: #065F46;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
  padding: 8px 16px;
}
.check-icon {
  background: #059669;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}
.preview-warning {
  font-size: .82rem;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  padding: 6px 12px;
  margin-top: 4px;
}
.preview-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.preview-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.preview-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.preview-table tr:last-child td { border-bottom: none; }
.preview-table tr:hover td { background: #f9fafb; }
.preview-more {
  color: var(--muted);
  font-size: .82rem;
  margin: 0 0 20px;
}
.preview-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.upload-status {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
}
.upload-status.info { background: #EEF7FF; color: var(--brand); border: 1px solid #BFDBFE; }
.upload-status.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Success step */
.import-success-card { text-align: center; padding: 40px 32px; }
.success-icon-wrap { margin-bottom: 20px; }
.success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  animation: pop-in .4s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.success-summary {
  font-size: 1rem;
  margin-bottom: 28px;
  color: var(--text);
}
.match-reveal {
  background: linear-gradient(135deg, #EEF7FF 0%, #F0F4FF 100%);
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 24px 32px;
  margin-bottom: 28px;
}
.match-reveal-header { display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.match-reveal-count {
  font-size: 3rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.match-reveal-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-dark);
}
.match-reveal-sub {
  color: var(--muted);
  font-size: .875rem;
  margin: 8px 0 0;
}
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Existing connections bar */
.existing-connections-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  z-index: 50;
}

/* ── Login page ─── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  padding: 40px 36px;
  text-align: center;
}
.login-logo { font-size: 1.8rem; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.login-tagline { color: var(--muted); margin: 0 0 32px; font-size: .9rem; }
.li-btn-wrap { margin-bottom: 24px; }
.login-divider { color: var(--muted); font-size: .8rem; margin: 0 0 16px; }
.login-disclaimer { font-size: .75rem; color: var(--muted); line-height: 1.5; }
.error-banner {
  background: #FEF2F2; color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .85rem;
  margin-bottom: 20px;
}
