/* ============================================
   APP.CSS — Pulse
   Sidebar layout, urgency-driven design
   ============================================ */

:root {
  --rp-red:      #dc2626;
  --rp-yellow:   #d97706;
  --rp-green:    #16a34a;
  --rp-gray:     #6b7280;
  --rp-blue:     #2563eb;
  --rp-text:     #111827;
  --rp-muted:    #6b7280;
  --rp-border:   #e5e7eb;
  --rp-bg:       #f9fafb;
  --rp-card:     #ffffff;
  --rp-surface:  #ffffff;
  --rp-surface2: #f3f4f6;
  --rp-sidebar-w: 220px;
}

/* -- Monospace everywhere -- */

body, input, textarea, select, button {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  color: var(--rp-text);
}

/* ============================================
   LAYOUT (sidebar + main)
   ============================================ */

.rp-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */

.rp-sidebar {
  width: var(--rp-sidebar-w);
  flex-shrink: 0;
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rp-sidebar-brand {
  padding: 18px 20px 14px;
}
.rp-sidebar-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.rp-sidebar-brand a:hover { color: #fff; }
.rp-sidebar-brand i { color: var(--rp-blue); }

.rp-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex: 1;
}

.rp-sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: .8125rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.rp-sidebar-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.rp-sidebar-link.active {
  background: var(--rp-blue);
  color: #fff;
}
.rp-sidebar-link i { font-size: 1rem; width: 18px; text-align: center; }

.rp-sidebar-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px 30px;
}
.rp-sidebar-sublink {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.rp-sidebar-sublink:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  text-decoration: none;
}
.rp-sidebar-sublink.active {
  color: #fff;
  background: rgba(37,99,235,.3);
}

.rp-sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: auto;
}

.rp-sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.rp-sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rp-blue);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-sidebar-user-info { min-width: 0; }

.rp-sidebar-user-name {
  font-size: .8125rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-sidebar-user-action {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
  text-decoration: none;
}
.rp-sidebar-user-action:hover { color: rgba(255,255,255,.75); }

/* ============================================
   MAIN AREA
   ============================================ */

.rp-main {
  flex: 1;
  min-width: 0;
  background: var(--rp-bg);
  display: flex;
  flex-direction: column;
}

/* ============================================
   TOP BAR (inside main area)
   ============================================ */

.rp-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 12px 24px;
  background: var(--rp-card);
  border-bottom: 1px solid var(--rp-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.rp-topbar-date {
  font-size: .8125rem;
  color: var(--rp-muted);
}

.rp-topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.rp-topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--rp-blue);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   CONTENT CONTAINER
   ============================================ */

.rp-content {
  max-width: 1020px;
  margin: 0 auto;
  padding: 20px 24px;
  width: 100%;
}

/* ============================================
   GREETING (Dashboard)
   ============================================ */

.rp-greeting {
  font-size: 1rem;
  color: var(--rp-text);
  padding: 16px 0 20px;
}
.rp-greeting strong { font-weight: 700; }

/* KPI stats row */
.rp-kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.rp-kpi {
  flex: 1;
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.rp-kpi-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rp-text);
  line-height: 1.2;
}
.rp-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rp-muted);
  margin-top: 2px;
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.rp-section {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 12px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rp-muted);
}

.rp-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rp-section-dot-red    { background: var(--rp-red); }
.rp-section-dot-green  { background: var(--rp-green); }
.rp-section-dot-gray   { background: var(--rp-gray); }

.rp-section-count {
  font-weight: 700;
  color: var(--rp-text);
}

.rp-section-link {
  margin-left: auto;
  font-size: .75rem;
  font-weight: 600;
  color: var(--rp-blue);
  text-decoration: none;
}
.rp-section-link:hover { text-decoration: underline; }

/* Buttons */
.rp-btn {
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--rp-border);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.rp-btn-primary {
  background: var(--rp-blue);
  color: #fff;
  border-color: var(--rp-blue);
}
.rp-btn-primary:hover { background: #1d4ed8; }
.rp-btn-ghost {
  background: transparent;
  color: var(--rp-muted);
  border-color: var(--rp-border);
}
.rp-btn-ghost:hover { background: #f3f4f6; }
.rp-btn-green {
  background: var(--rp-green);
  color: #fff;
  border-color: var(--rp-green);
}
.rp-btn-green:hover { background: #15803d; }
.rp-btn-outline {
  background: transparent;
  color: var(--rp-blue);
  border-color: var(--rp-blue);
}
.rp-btn-outline:hover { background: #eff6ff; }

/* ============================================
   CONTACT CARDS (Contacts list)
   ============================================ */

.rp-ccard {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 12px 14px;
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-bottom: none;
  transition: background .12s;
}
.rp-ccard:first-child { border-radius: 6px 6px 0 0; }
.rp-ccard:last-child { border-bottom: 1px solid var(--rp-border); border-radius: 0 0 6px 6px; }
.rp-ccard:only-child { border-radius: 6px; border-bottom: 1px solid var(--rp-border); }
.rp-ccard:hover { background: #fafbfc; }

.rp-ccard-icon {
  flex-shrink: 0;
  padding-top: 2px;
  font-size: .9rem;
}

.rp-ccard-body { flex: 1 1 0; min-width: 0; }

.rp-ccard-name {
  font-weight: 700;
  font-size: .875rem;
  color: var(--rp-text);
  text-decoration: none;
}
.rp-ccard-name:hover { text-decoration: underline; }

.rp-ccard-meta {
  font-size: .8125rem;
  color: var(--rp-muted);
  margin-top: 1px;
}

.rp-ccard-context {
  font-size: .75rem;
  color: var(--rp-muted);
  margin-top: 2px;
}

.rp-ccard-action {
  flex-shrink: 0;
  align-self: center;
}

.rp-ccard-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  align-self: center;
}
.rp-ccard-days {
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 4px;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.rp-search {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 16px;
}

.rp-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--rp-border);
  border-radius: 4px;
  font-size: .8125rem;
  background: var(--rp-card);
}
.rp-search input:focus { outline: none; border-color: var(--rp-blue); }

/* ============================================
   CONTACT PROFILE
   ============================================ */

.rp-profile-header {
  margin-bottom: 16px;
}

.rp-profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rp-text);
  margin-bottom: 2px;
}

.rp-profile-title-line {
  font-size: .875rem;
  color: var(--rp-muted);
}

.rp-profile-contact {
  font-size: .8125rem;
  color: var(--rp-muted);
  margin-top: 4px;
}
.rp-profile-contact a { color: var(--rp-blue); text-decoration: none; }

.rp-profile-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rp-border);
  border-bottom: 1px solid var(--rp-border);
}

.rp-profile-stat-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rp-muted);
  margin-bottom: 1px;
}

.rp-profile-stat-value {
  font-size: .875rem;
  font-weight: 700;
  color: var(--rp-text);
}

/* Detail fields */
.rp-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: .8125rem;
}

.rp-detail-label {
  font-weight: 600;
  color: var(--rp-muted);
  text-align: right;
  white-space: nowrap;
}

.rp-detail-value {
  color: var(--rp-text);
}

/* Submissions list in profile */
.rp-sub-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--rp-border);
  font-size: .8125rem;
}
.rp-sub-item:last-child { border-bottom: none; }

.rp-sub-role {
  font-weight: 700;
  color: var(--rp-text);
  text-decoration: none;
}
.rp-sub-role:hover { text-decoration: underline; }

.rp-sub-date {
  color: var(--rp-muted);
  font-size: .75rem;
}

/* Stage badges */
.rp-badge {
  display: inline-block;
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ============================================
   JOB DETAIL
   ============================================ */

.rp-job-header {
  margin-bottom: 20px;
}

.rp-job-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rp-text);
  margin-bottom: 2px;
}

.rp-job-meta-line {
  font-size: .875rem;
  color: var(--rp-muted);
}

.rp-job-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: .8125rem;
  color: var(--rp-muted);
}

.rp-job-stat-val { font-weight: 700; color: var(--rp-text); }

/* ── Empty states ── */
.rp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
}
.rp-empty-icon {
  font-size: 2.5rem;
  opacity: .25;
  margin-bottom: 16px;
}
.rp-empty-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--rp-text);
  margin-bottom: 6px;
}
.rp-empty-desc {
  font-size: .875rem;
  color: var(--rp-muted);
  max-width: 340px;
  line-height: 1.5;
}
.rp-empty-cta {
  margin-top: 20px;
}
/* Activity log */
.rp-activity-item {
  display: flex;
  gap: .5rem;
  padding: 6px 0;
  font-size: .8125rem;
  border-bottom: 1px solid var(--rp-border);
}
.rp-activity-item:last-child { border-bottom: none; }

.rp-activity-date {
  flex-shrink: 0;
  color: var(--rp-muted);
  font-weight: 600;
  width: 50px;
}

.rp-activity-text { color: var(--rp-text); }

/* ============================================
   CARD (generic)
   ============================================ */

.rp-card {
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.rp-card-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rp-muted);
  margin-bottom: 12px;
}

/* ============================================
   BACK LINK
   ============================================ */

.rp-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8125rem;
  color: var(--rp-muted);
  text-decoration: none;
  margin-bottom: 16px;
}
.rp-back:hover { color: var(--rp-text); }

/* ============================================
   UTILITIES
   ============================================ */

.rp-text-red    { color: var(--rp-red); }
.rp-text-yellow { color: var(--rp-yellow); }
.rp-text-green  { color: var(--rp-green); }
.rp-text-gray   { color: var(--rp-gray); }
.rp-text-muted  { color: var(--rp-muted); }

.rp-fw-700 { font-weight: 700; }

/* ============================================
   ONBOARDING SCREEN
   ============================================ */

.rp-onboard {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

.rp-onboard-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rp-text);
  text-align: center;
  margin-bottom: 24px;
}

/* Steps indicator */
.rp-onboard-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.rp-onboard-step {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 10px 12px;
  font-size: .8125rem;
  color: var(--rp-muted);
  border-left: 3px solid var(--rp-border);
  transition: border-color .2s, color .2s;
}

.rp-onboard-step-active {
  border-left-color: var(--rp-blue);
  color: var(--rp-text);
}

.rp-onboard-step-done {
  border-left-color: var(--rp-green);
  color: var(--rp-text);
}

.rp-onboard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--rp-border);
  color: var(--rp-muted);
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-onboard-step-done .rp-onboard-step-num {
  background: var(--rp-green);
  color: #fff;
}

.rp-onboard-step-active .rp-onboard-step-num {
  background: var(--rp-blue);
  color: #fff;
}

.rp-onboard-step-label {
  flex: 1;
  font-weight: 600;
}

.rp-onboard-step-status {
  font-size: .625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rp-green);
}

/* Onboarding body */
.rp-onboard-body {
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  padding: 24px 20px;
}

/* Scan animation */
.rp-onboard-scan-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--rp-blue);
  margin-bottom: 16px;
}

.rp-spin {
  animation: rp-spin 1s linear infinite;
}
@keyframes rp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Progress bar */
.rp-onboard-bar-wrap {
  height: 6px;
  background: var(--rp-border);
  border-radius: 3px;
  overflow: hidden;
}

.rp-onboard-bar {
  height: 100%;
  background: var(--rp-blue);
  border-radius: 3px;
  transition: width .15s ease;
}

/* Counters */
.rp-onboard-counters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.rp-onboard-counter {
  font-size: .8125rem;
  color: var(--rp-text);
}

.rp-onboard-note {
  font-size: .8125rem;
  color: var(--rp-muted);
  margin-top: 16px;
  margin-bottom: 0;
  text-align: center;
}

/* ============================================
   DRAFT EMAIL MODAL
   ============================================ */

[x-cloak] { display: none !important; }

.rp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}

.rp-modal {
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.rp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rp-border);
}

.rp-modal-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--rp-text);
}

.rp-modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--rp-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.rp-modal-close:hover { color: var(--rp-text); }

/* AI reasoning */
.rp-modal-reasoning {
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  padding: 12px 18px;
}

.rp-modal-reasoning-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rp-blue);
  margin-bottom: 4px;
}

.rp-modal-reasoning-text {
  font-size: .8125rem;
  color: var(--rp-text);
  line-height: 1.5;
}

/* Email form */
.rp-modal-body {
  padding: 16px 18px;
}

.rp-modal-field {
  margin-bottom: 12px;
}

.rp-modal-label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rp-muted);
  margin-bottom: 4px;
}

.rp-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rp-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: .8125rem;
  color: var(--rp-text);
  background: var(--rp-bg);
}
.rp-modal-input:focus { outline: none; border-color: var(--rp-blue); }
.rp-modal-input[readonly] { background: #f3f4f6; color: var(--rp-muted); }

.rp-modal-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rp-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: .8125rem;
  color: var(--rp-text);
  background: var(--rp-bg);
  resize: vertical;
  line-height: 1.5;
}
.rp-modal-textarea:focus { outline: none; border-color: var(--rp-blue); }

/* Footer actions */
.rp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--rp-border);
}

/* Toast inside modal */
.rp-modal-toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rp-green);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: .8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}


/* ===================================================================
   SEARCH PAGE
   =================================================================== */

/* Search hero area */
.rp-search-hero {
  text-align: center;
  padding: 32px 0 8px;
}

.rp-search-hero-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--rp-blue);
  margin-bottom: 12px;
}

.rp-search-hero-label i {
  margin-right: 4px;
}

/* Search form & bar */
.rp-search-form {
  max-width: 640px;
  margin: 0 auto;
}

.rp-search-bar {
  display: flex;
  align-items: center;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  padding: 4px 4px 4px 14px;
  gap: 8px;
  transition: border-color .15s;
}

.rp-search-bar:focus-within {
  border-color: var(--rp-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}

.rp-search-bar-icon {
  color: var(--rp-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.rp-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: .9375rem;
  color: var(--rp-text);
  padding: 8px 0;
}

.rp-search-bar input::placeholder {
  color: var(--rp-muted);
}

.rp-search-bar-btn {
  flex-shrink: 0;
  padding: 8px 18px !important;
  font-size: .8125rem !important;
}

/* Hint chips */
.rp-search-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.rp-search-hint {
  font-size: .75rem;
  color: var(--rp-muted);
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 100px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all .15s;
}

.rp-search-hint:hover {
  color: var(--rp-blue);
  border-color: var(--rp-blue);
  background: rgba(59, 130, 246, .05);
}

/* Results header */
.rp-search-results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--rp-text);
}

/* Search result card */
.rp-scard {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: border-color .15s;
}

.rp-scard:hover {
  border-color: rgba(59, 130, 246, .3);
}

/* Card body */
.rp-scard-body {
  flex: 1;
  min-width: 0;
}

.rp-scard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rp-scard-name {
  font-weight: 600;
  color: var(--rp-text);
  text-decoration: none;
  font-size: .9375rem;
}

.rp-scard-name:hover {
  color: var(--rp-blue);
}

.rp-scard-days {
  font-size: .75rem;
  color: var(--rp-muted);
  white-space: nowrap;
}

.rp-scard-meta {
  font-size: .8125rem;
  color: var(--rp-muted);
  margin-top: 2px;
}

/* Card action buttons */
.rp-scard-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
}

/* Empty state */
.rp-search-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--rp-muted);
}

.rp-search-empty-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--rp-text);
  margin-top: 8px;
}

/* ── OAuth / Auth buttons ── */

.rp-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rp-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  border: 1px solid var(--rp-border);
  position: relative;
}

.rp-oauth-icon {
  flex-shrink: 0;
}

/* Google button */
.rp-oauth-google {
  background: #fff;
  color: #3c4043;
  border-color: #dadce0;
}
.rp-oauth-google:hover {
  background: #f7f8f8;
  border-color: #c6c9cd;
  color: #3c4043;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Microsoft button (disabled) */
.rp-oauth-microsoft {
  background: var(--rp-card);
  color: var(--rp-muted);
  border-color: var(--rp-border);
}
.rp-oauth-microsoft:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.rp-oauth-badge {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--rp-border);
  color: var(--rp-muted);
  padding: 2px 8px;
  border-radius: 10px;
  position: absolute;
  right: 12px;
}

/* Divider */
.rp-oauth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 16px;
  gap: 12px;
}
.rp-oauth-divider::before,
.rp-oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rp-border);
}
.rp-oauth-divider span {
  font-size: .75rem;
  color: var(--rp-muted);
  white-space: nowrap;
}

/* ── Settings Page ─────────────────────────────────────────────── */
.rp-settings {
  padding-bottom: 48px;
}
.rp-settings-header {
  margin-bottom: 20px;
}
.rp-settings-back {
  font-size: .8125rem;
  color: var(--rp-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.rp-settings-back:hover { color: var(--rp-text); }
.rp-settings-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rp-text);
}

/* Sections */
.rp-settings-section { margin-bottom: 28px; }
.rp-settings-section-label {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--rp-muted);
  margin-bottom: 8px;
}

/* Cards */
.rp-settings-card {
  background: var(--rp-card);
  border: 1px solid var(--rp-border);
  border-radius: 10px;
  padding: 0;
}
.rp-settings-card-danger {
  border-color: rgba(239,68,68,.25);
}

.rp-settings-divider {
  height: 1px;
  background: var(--rp-border);
  margin: 0 16px;
}

/* Profile card */
.rp-settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
}
.rp-settings-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rp-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rp-settings-profile-info { flex: 1; min-width: 0; }
.rp-settings-profile-name {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--rp-text);
}
.rp-settings-profile-email {
  font-size: .8125rem;
  color: var(--rp-muted);
}
.rp-settings-profile-company {
  font-size: .8125rem;
  color: var(--rp-muted);
}
.rp-settings-edit-btn {
  flex-shrink: 0;
  font-size: .8125rem;
}

/* Generic row */
.rp-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.rp-settings-row-block {
  flex-wrap: wrap;
}
.rp-settings-row-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rp-settings-row-body { flex: 1; min-width: 0; }
.rp-settings-row-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--rp-text);
}
.rp-settings-row-sub {
  font-size: .8125rem;
  color: var(--rp-muted);
  margin-top: 1px;
}
.rp-settings-row-meta {
  font-size: .75rem;
  color: var(--rp-muted);
  margin-top: 2px;
}
.rp-settings-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.rp-settings-row-right-col {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Connection status badges */
.rp-settings-status {
  font-size: .75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.rp-settings-status-on { color: var(--rp-green); }
.rp-settings-status-off { color: var(--rp-muted); }

/* Toggle switch */
.rp-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.rp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.rp-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--rp-border);
  border-radius: 12px;
  transition: background .2s;
}
.rp-toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.rp-toggle input:checked + .rp-toggle-track {
  background: var(--rp-blue);
}
.rp-toggle input:checked + .rp-toggle-track::after {
  transform: translateX(20px);
}

/* Radio buttons */
.rp-settings-radios {
  display: flex;
  gap: 20px;
  padding: 8px 0 4px;
  width: 100%;
}
.rp-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: var(--rp-text);
  cursor: pointer;
}
.rp-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.rp-radio-dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--rp-border);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s;
}
.rp-radio-dot::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: var(--rp-blue);
  transform: scale(0);
  transition: transform .15s;
}
.rp-radio input:checked ~ .rp-radio-dot {
  border-color: var(--rp-blue);
}
.rp-radio input:checked ~ .rp-radio-dot::after {
  transform: scale(1);
}

/* Text input */
.rp-settings-input {
  width: 100%;
  padding: 8px 12px;
  font-size: .875rem;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  background: var(--rp-bg);
  color: var(--rp-text);
  margin-top: 4px;
}
.rp-settings-input:focus {
  outline: none;
  border-color: var(--rp-blue);
}

/* Danger button */
.rp-btn-danger {
  background: var(--rp-red, #ef4444);
  color: #fff;
  border: none;
}
.rp-btn-danger:hover {
  background: #dc2626;
}
.rp-btn-sm {
  font-size: .8125rem;
  padding: 5px 12px;
}

/* ============================================
   BADGE COLOR VARIANTS (missing from original)
   ============================================ */

.rp-badge-blue  { background: #dbeafe; color: #1d4ed8; }
.rp-badge-green { background: #dcfce7; color: #15803d; }
.rp-badge-red   { background: #fee2e2; color: #991b1b; }
.rp-badge-muted { background: var(--rp-surface2); color: var(--rp-muted); }

/* ============================================
   EMAIL THREAD CLASSIFICATION TAGS
   Used in emails.html for client/peer/vendor etc.
   ============================================ */

.rp-tag {
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}
.rp-tag-client   { color: #16a34a; background: #f0fdf4; border: 1px solid rgba(22,163,74,.25); }
.rp-tag-peer     { color: #8b5cf6; background: #f5f3ff; border: 1px solid rgba(139,92,246,.25); }
.rp-tag-vendor   { color: #f59e0b; background: #fefce8; border: 1px solid rgba(245,158,11,.25); }
.rp-tag-personal { color: #ec4899; background: #fdf2f8; border: 1px solid rgba(236,72,153,.25); }
.rp-tag-internal { color: #0ea5e9; background: #f0f9ff; border: 1px solid rgba(14,165,233,.25); }
.rp-tag-muted    { color: var(--rp-muted); background: var(--rp-surface2); border: 1px solid var(--rp-border); }

/* ============================================
   CONTACT SOURCE BADGE VARIANTS
   Used in contacts.html and contact.html
   ============================================ */

.rp-source-badge { margin-left: 4px; font-size: 10px; }
.rp-source-referral    { background: #0a2a1a; color: #4ade80; border: 1px solid rgba(74,222,128,.3); }
.rp-source-inbound     { background: #0a1a2a; color: #60a5fa; border: 1px solid rgba(96,165,250,.3); }
.rp-source-cold        { background: var(--rp-surface2); color: var(--rp-muted); }
.rp-source-linkedin    { background: #0a1a30; color: #60a5fa; border: 1px solid rgba(96,165,250,.3); }
.rp-source-event       { background: #1a0a2a; color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }

/* ============================================
   DARK STATUS BADGE VARIANTS
   Reusable dark-background pill badges for
   sentiment, lifecycle stage, and signal labels.
   ============================================ */

/* Extra-small badge — 9px variant used in pipeline table/kanban */
.rp-badge-xs { font-size: 9px; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }

/* Positive / success (dark emerald green) */
.rp-badge-pos  { background: #0a2a1a; color: #34d399; border: 1px solid rgba(52,211,153,.3); }
/* Informational (dark blue) */
.rp-badge-info { background: #0a1a2a; color: #60a5fa; border: 1px solid rgba(96,165,250,.3); }
/* Warning / caution (dark amber) */
.rp-badge-warn { background: #2a1a00; color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
/* Danger / negative (dark red) */
.rp-badge-neg  { background: #2a0a0a; color: #f87171; border: 1px solid rgba(248,113,113,.3); }
/* Purple / peer */
.rp-badge-purple { background: #1a0a2a; color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }

/* ============================================
   DOCUMENT CATEGORY TAGS
   Used in company_detail.html for doc type and
   draft/signed status labels.
   ============================================ */

.rp-tag-contract { color: #60a5fa; background: #0a1a2a; border: 1px solid rgba(96,165,250,.3); }
.rp-tag-sow      { color: #a78bfa; background: #1a0a2a; border: 1px solid rgba(167,139,250,.3); }
.rp-tag-draft    { color: #fbbf24; background: #2a1a00; border: 1px solid rgba(251,191,36,.3); }
.rp-tag-signed   { color: #34d399; background: #001a0a; border: 1px solid rgba(52,211,153,.3); }
