/* ============================================================
   CardStack — Design System v1.0
   Poppins · Deep Navy · Electric Purple · Bright Blue · Cyan
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
  --navy:    #0A0F1F;
  --navy2:   #141929;
  --purple:  #7C3AED;
  --purpleD: #5B21B6;
  --purpleL: #A78BFA;
  --purpleXL:#EDE9FE;
  --blue:    #2563EB;
  --blueL:   #EFF6FF;
  --cyan:    #00D4FF;
  --green:   #059669;
  --greenL:  #ECFDF5;
  --amber:   #D97706;
  --amberL:  #FFFBEB;
  --red:     #DC2626;
  --redL:    #FEF2F2;
  --gray:    #E5E7EB;
  --gray2:   #F3F4F6;
  --gray3:   #F9FAFB;
  --muted:   #6B7280;
  --body:    #1F2937;
  --white:   #FFFFFF;
  --font:    'Poppins', system-ui, -apple-system, sans-serif;
  --radius:  18px;
  --radiusS: 10px;
  --radiusXS: 6px;
  --shadow:  0 4px 24px rgba(10,15,31,.08);
  --shadowM: 0 8px 40px rgba(10,15,31,.12);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--body); background: #F1F0F8; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }

/* ── App shell ── */
.app-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  background: var(--navy);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo { padding: 24px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.logo-link { display: block; }
.logo-text { font-size: 20px; font-weight: 800; color: var(--white); letter-spacing: -.3px; }
.logo-accent { color: var(--purpleL); }
.logo-tag { font-size: 9px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }

.sidebar-user { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: var(--white); flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--white); line-height: 1.3; }
.user-tier { font-size: 10px; color: rgba(255,255,255,.4); margin-top: 1px; }

.sidebar-nav { padding: 10px; flex: 1; }
.nav-section { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.22); padding: 10px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radiusS);
  color: rgba(255,255,255,.5); font-size: 13px; font-weight: 500;
  transition: all .14s; margin-bottom: 1px; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); }
.nav-item.active { background: rgba(124,58,237,.22); color: var(--white); }
.nav-item--logout { color: rgba(255,255,255,.35); margin-top: 4px; }
.nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: var(--white); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; min-width: 20px; text-align: center; }

.sidebar-upgrade { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.btn-upgrade { display: block; text-align: center; padding: 9px; border-radius: var(--radiusS); background: rgba(124,58,237,.25); color: var(--purpleL); font-size: 12px; font-weight: 600; border: 1px solid rgba(124,58,237,.3); transition: all .15s; }
.btn-upgrade:hover { background: rgba(124,58,237,.4); }

/* ── Main content ── */
.main-content { overflow-y: auto; }

/* ── Page header ── */
.page-header { background: var(--white); padding: 24px 32px 20px; border-bottom: 1px solid var(--gray); }
.page-title { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* ── Content padding ── */
.content { padding: 24px 32px; }

/* ── Cards / panels ── */
.panel { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.panel-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.panel-title em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 8px; }

/* ── Stats strip ── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 20px 22px; }
.stat-num { font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.c-purple { color: var(--purple); }
.c-red    { color: var(--red); }
.c-green  { color: var(--green); }
.c-blue   { color: var(--blue); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; border: none; transition: all .15s; white-space: nowrap; line-height: 1.4; }
.btn-primary { background: var(--purple); color: var(--white) !important; }
.btn-primary:hover { background: var(--purpleD); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,58,237,.3); }
.btn-dark  { background: var(--navy);  color: var(--white) !important; }
.btn-dark:hover  { opacity: .88; }
.btn-green { background: var(--green); color: var(--white) !important; }
.btn-green:hover { background: #047857; }
.btn-ghost { background: var(--gray2); color: var(--body) !important; border: 1px solid var(--gray); }
.btn-ghost:hover { background: var(--gray); }
.btn-red   { background: var(--redL);  color: var(--red) !important; border: 1px solid rgba(220,38,38,.2); }
.btn-sm    { padding: 5px 13px; font-size: 12px; }
.btn-xs    { padding: 3px 10px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1/-1; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray); border-radius: var(--radiusS);
  font-size: 14px; font-family: var(--font); color: var(--body);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.form-input:disabled, .form-input[disabled] { background: var(--gray3); color: var(--muted); cursor: not-allowed; }
.form-textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Reminder picker ── */
.reminder-row { display: flex; gap: 8px; flex-wrap: wrap; }
.reminder-btn { padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--gray); background: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: var(--font); }
.reminder-btn:hover { border-color: var(--purple); }
.reminder-btn.active { background: var(--purple); border-color: var(--purple); color: var(--white); }

/* ── Tags ── */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip { padding: 5px 14px; border-radius: 999px; border: 1.5px solid var(--gray); background: var(--white); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.tag-chip.active { background: var(--purple); border-color: var(--purple); color: var(--white); }
.tag-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: rgba(124,58,237,.1); color: var(--purple); font-size: 11px; font-weight: 600; }

/* ── Pipeline items ── */
.pipeline-item {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--gray); border-radius: var(--radiusS);
  margin-bottom: 8px; background: var(--white); transition: box-shadow .15s;
}
.pipeline-item:hover { box-shadow: var(--shadow); }
.pipeline-item.overdue { border-color: rgba(220,38,38,.25); background: #FFF8F8; }
.pipeline-item.due-soon { border-color: rgba(217,119,6,.25); background: #FFFDF5; }
.pi-name { font-weight: 700; font-size: 14px; color: var(--navy); }
.pi-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pi-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── Due badges ── */
.due-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.due-overdue  { background: var(--redL);   color: var(--red); }
.due-soon     { background: var(--amberL); color: var(--amber); }
.due-pending  { background: var(--blueL);  color: var(--blue); }
.due-done     { background: var(--greenL); color: var(--green); }

/* ── Contact rows ── */
.contact-row {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--gray); border-radius: var(--radiusS);
  margin-bottom: 8px; background: var(--white); transition: box-shadow .15s;
}
.contact-row:hover { box-shadow: var(--shadow); }
.contact-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--purple),var(--blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--white); flex-shrink: 0; }
.contact-name  { font-weight: 700; font-size: 15px; color: var(--navy); }
.contact-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.contact-event { font-size: 12px; color: var(--muted); margin-top: 3px; }
.contact-note  { font-size: 13px; font-style: italic; color: var(--body); margin-top: 5px; line-height: 1.5; }
.contact-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.contact-actions { display: flex; flex-direction: column; gap: 5px; min-width: 90px; align-items: flex-end; }

/* ── Bulk action bar (My Stack multi-select → add to collection) ── */
.bulk-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60;
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--navy); color: var(--white); padding: 10px 14px;
  border-radius: 14px; box-shadow: var(--shadow); max-width: calc(100% - 24px);
}
.bulk-bar.show { display: flex; }
.bulk-bar select, .bulk-bar input {
  padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25);
  background: var(--white); color: var(--navy); font: inherit;
}
@media (max-width: 768px) { .bulk-bar { bottom: 74px; } }

/* ── Virtual card preview ── */
.card-preview {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  border-radius: 20px; padding: 28px; color: var(--white); position: relative; overflow: hidden;
}
.card-preview::before { content: ''; position: absolute; top: -40px; right: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(124,58,237,.18); pointer-events: none; }
.card-preview::after  { content: ''; position: absolute; bottom: -30px; left: 60px; width: 150px; height: 150px; border-radius: 50%; background: rgba(37,99,235,.12); pointer-events: none; }
.card-avatar { width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg,var(--purple),var(--blue)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; color: var(--white); margin-bottom: 14px; position: relative; z-index: 1; border: 3px solid rgba(255,255,255,.12); }
.card-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; position: relative; z-index: 1; }
.card-role { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 14px; position: relative; z-index: 1; }
.card-intent { display: inline-flex; align-items: center; gap: 5px; background: rgba(124,58,237,.28); border: 1px solid rgba(124,58,237,.45); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--purpleL); margin-bottom: 14px; position: relative; z-index: 1; }
.card-contact { display: flex; align-items: center; gap: 9px; font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 7px; position: relative; z-index: 1; }
.card-contact-icon { width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.card-url { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--purpleL); margin-top: 14px; position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; word-break: break-all; }
.card-edit-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 860px) { .card-edit-grid { grid-template-columns: 1fr; } }

/* ── QR box ── */
.qr-box { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 20px; text-align: center; }
.qr-box img { width: 140px; border-radius: 10px; margin: 0 auto 12px; display: block; }
.qr-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }

/* ── Share buttons ── */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.share-btn { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--gray); border-radius: var(--radiusS); background: var(--white); cursor: pointer; font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--body); transition: all .15s; text-decoration: none; }
.share-btn:hover { border-color: var(--purple); background: var(--purpleXL); }
.share-icon { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }

/* ── NFC hint ── */
.nfc-hint { background: linear-gradient(135deg,rgba(0,212,255,.06),rgba(124,58,237,.06)); border: 1px solid rgba(124,58,237,.15); border-radius: var(--radiusS); padding: 10px 14px; font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

/* ── Analytics bars ── */
.an-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.an-bar-label { font-size: 12px; color: var(--muted); width: 72px; flex-shrink: 0; }
.an-bar-track { flex: 1; height: 6px; background: var(--gray); border-radius: 999px; overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 999px; background: var(--purple); transition: width .4s ease; }
.an-bar-count { font-size: 12px; font-weight: 600; color: var(--body); width: 28px; text-align: right; flex-shrink: 0; }

/* ── Search ── */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 180px; border: 1.5px solid var(--gray); border-radius: 999px; padding: 9px 18px; font-size: 14px; font-family: var(--font); outline: none; color: var(--body); }
.search-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,58,237,.08); }
.filter-select { border: 1.5px solid var(--gray); border-radius: 999px; padding: 9px 14px; font-size: 13px; font-family: var(--font); background: var(--white); color: var(--body); outline: none; }

/* ── Tab strip ── */
.tab-row { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--gray); background: var(--white); color: var(--muted); transition: all .15s; font-family: var(--font); text-decoration: none; }
.tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tab:hover:not(.active) { border-color: var(--purple); color: var(--purple); }

/* ── Toggle ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--gray2); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; font-weight: 500; }
.toggle-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--gray); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; border: none; outline: none; }
.toggle.on { background: var(--purple); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s; }
.toggle.on::after { transform: translateX(18px); }

/* ── Alert / flash ── */
.flash { padding: 14px 20px; font-size: 14px; font-weight: 500; margin: 16px 32px 0; border-radius: var(--radiusS); }
.flash--error   { background: var(--redL);   color: #991B1B; }
.flash--success { background: var(--greenL); color: var(--green); }
.alert { padding: 12px 16px; border-radius: var(--radiusS); font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.alert-error   { background: var(--redL);   color: #991B1B; }
.alert-success { background: var(--greenL); color: var(--green); }
.alert-info    { background: var(--blueL);  color: #1E40AF; }

/* ── Empty state ── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 14px; }
.empty p { font-size: 15px; }

/* ── Public card ── */
.public-wrap { min-height: 100vh; background: #F1F0F8; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px 80px; }
.public-card { width: 100%; max-width: 380px; }
.public-card-inner { background: var(--white); border: 1px solid var(--gray); border-radius: 24px; overflow: hidden; box-shadow: var(--shadowM); }
.pub-header { background: linear-gradient(135deg,var(--navy),var(--navy2)); padding: 32px 28px 28px; position: relative; overflow: hidden; }
.pub-header::before { content: ''; position: absolute; top: -50px; right: -50px; width: 200px; height: 200px; border-radius: 50%; background: var(--accglow,rgba(124,58,237,.18)); pointer-events: none; }
.pub-photo { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg,var(--acc1,var(--purple)),var(--acc2,var(--blue))); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; color: var(--white); margin-bottom: 14px; border: 3px solid rgba(255,255,255,.12); position: relative; z-index: 1; }
.pub-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pub-name { font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 4px; position: relative; z-index: 1; }
.pub-role { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 12px; position: relative; z-index: 1; }
.pub-intent { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,.12); border: 1px solid var(--acc1,rgba(124,58,237,.45)); border-radius: 999px; padding: 3px 11px; font-size: 11px; font-weight: 600; color: #fff; position: relative; z-index: 1; }
.pub-body { padding: 24px; }
.pub-bio { font-size: 14px; line-height: 1.6; color: var(--muted); margin-bottom: 16px; }
.pub-contact { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pub-contact-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--gray2); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.pub-contact-link { font-size: 13px; font-weight: 500; color: var(--blue); word-break: break-all; }
.pub-divider { border: none; border-top: 1px solid var(--gray); margin: 18px 0; }
.pub-actions { display: flex; flex-direction: column; gap: 8px; }
.pub-btn-primary { width: 100%; padding: 13px; border-radius: 999px; background: var(--acc1,var(--purple)); color: var(--white); font-weight: 700; font-size: 15px; font-family: var(--font); border: none; cursor: pointer; transition: all .15s; }
.pub-btn-primary:hover { background: var(--purpleD); }
.pub-btn-secondary { width: 100%; padding: 12px; border-radius: 999px; background: var(--white); color: var(--navy); font-weight: 600; font-size: 14px; font-family: var(--font); border: 1.5px solid var(--gray); cursor: pointer; transition: all .15s; }
.pub-btn-secondary:hover { background: var(--gray2); }
.pub-share-row { display: flex; gap: 8px; margin-top: 8px; }
.pub-share-btn { flex: 1; padding: 9px 6px; border-radius: var(--radiusS); background: var(--gray2); border: 1px solid var(--gray); font-size: 12px; font-weight: 600; font-family: var(--font); cursor: pointer; color: var(--body); transition: all .15s; text-align: center; }
.pub-share-btn:hover { background: var(--gray); }
.pub-powered { text-align: center; font-size: 11px; color: var(--muted); margin-top: 16px; padding-bottom: 2px; }
.pub-powered a { color: var(--purple); font-weight: 600; }

/* ── Card themes: accent vars (--acc1/--acc2/--accglow) set inline on .public-card-inner ── */
.pub-socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pub-social { width: 38px; height: 38px; border-radius: 50%; background: var(--gray2); border: 1px solid var(--gray); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--navy); text-decoration: none; transition: all .15s; }
.pub-social:hover { background: var(--gray); transform: translateY(-1px); }
.pub-cover { height: 84px; margin: 0 -28px 14px; background: linear-gradient(115deg,var(--acc1,var(--purple)),var(--acc2,var(--blue))); background-size: cover; background-position: center; }
.pub-theme-cover .pub-header { background: var(--white); padding: 0 28px 22px; text-align: center; }
.pub-theme-cover .pub-header::before { display: none; }
.pub-theme-cover .pub-photo { margin: -34px auto 12px; border: 4px solid var(--white); }
.pub-theme-cover .pub-name { color: var(--navy); }
.pub-theme-cover .pub-role { color: var(--muted); }
.pub-theme-cover .pub-intent { background: var(--gray2); border-color: var(--acc1,var(--purple)); color: var(--navy); }
.pub-theme-duotone .pub-header { background: linear-gradient(160deg,var(--acc1,var(--purple)),var(--acc2,var(--blue))); padding: 28px 28px 26px; }
.pub-theme-duotone .pub-header::before { display: none; }
.pub-theme-duotone .pub-photo { border-radius: 18px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); }

/* Minimal — white header, accent top bar, dark text */
.pub-theme-minimal .pub-header { background: var(--white); border-top: 4px solid var(--acc1,var(--purple)); padding: 26px 28px 20px; }
.pub-theme-minimal .pub-header::before { display: none; }
.pub-theme-minimal .pub-photo { background: var(--gray2); color: var(--acc1,var(--purple)); border: 1px solid var(--gray); }
.pub-theme-minimal .pub-name { color: var(--navy); }
.pub-theme-minimal .pub-role { color: var(--muted); }
.pub-theme-minimal .pub-intent { background: var(--gray2); border-color: var(--acc1,var(--purple)); color: var(--navy); }

/* Spotlight — centered hero avatar with accent ring on white */
.pub-theme-spotlight .pub-header { background: var(--white); text-align: center; padding: 28px 28px 18px; }
.pub-theme-spotlight .pub-header::before { display: none; }
.pub-theme-spotlight .pub-photo { width: 84px; height: 84px; margin: 0 auto 14px; box-shadow: 0 0 0 4px var(--white), 0 0 0 9px var(--accglow,rgba(124,58,237,.3)); }
.pub-theme-spotlight .pub-name { color: var(--navy); }
.pub-theme-spotlight .pub-role { color: var(--muted); }
.pub-theme-spotlight .pub-intent { background: var(--gray2); border-color: var(--acc1,var(--purple)); color: var(--navy); }

/* Sidebar — accent column (avatar) + info column */
.pub-theme-sidebar.public-card-inner { display: flex; align-items: stretch; }
.pub-theme-sidebar .pub-header { width: 40%; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; padding: 22px 16px; background: linear-gradient(160deg,var(--acc1,var(--purple)),var(--acc2,var(--blue))); }
.pub-theme-sidebar .pub-header::before { display: none; }
.pub-theme-sidebar .pub-body { flex: 1; }

/* Photo background — full-bleed photo + scrim, text overlaid */
.pub-theme-photo .pub-header { position: relative; min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; background-image: var(--photo,linear-gradient(135deg,var(--acc1,var(--purple)),var(--acc2,var(--blue)))); background-size: cover; background-position: center; }
.pub-theme-photo .pub-header::before { top: 0; left: 0; right: 0; bottom: 0; width: auto; height: auto; border-radius: 0; background: linear-gradient(to top,rgba(10,15,31,.92),rgba(10,15,31,.12)); }
.pub-theme-photo .pub-photo { display: none; }
.pub-theme-photo .pub-name, .pub-theme-photo .pub-role, .pub-theme-photo .pub-intent { position: relative; z-index: 1; }

/* ── Auth screens ── */
.auth-wrap { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { background: var(--white); border-radius: 24px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.auth-logo { font-size: 28px; font-weight: 800; color: var(--navy); text-align: center; margin-bottom: 4px; }
.auth-logo span { color: var(--purple); }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 28px; line-height: 1.5; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.auth-divider-line { flex: 1; height: 1px; background: var(--gray); }
.auth-divider-text { font-size: 12px; color: var(--muted); }
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 22px; }
.auth-footer a { color: var(--purple); font-weight: 600; }

/* ── Mobile sticky nav ── */
.mobile-bar { display: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mobile-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: var(--white); border-top: 1px solid var(--gray);
    box-shadow: 0 -4px 20px rgba(10,15,31,.1);
    padding-bottom: env(safe-area-inset-bottom,0);
  }
  .mb-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px 12px; color: var(--muted); font-size: 10px; font-weight: 600; text-decoration: none; gap: 3px; position: relative; transition: color .15s; }
  .mb-item.active { color: var(--purple); }
  .mb-icon { font-size: 20px; line-height: 1; }
  .mb-badge { position: absolute; top: 6px; right: calc(50% - 18px); background: var(--red); color: var(--white); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 999px; }
  .mb-more { background: none; border: 0; cursor: pointer; font-family: inherit; }
  body { padding-bottom: 68px; }
  .content { padding: 16px; }
  .page-header { padding: 18px 16px 14px; }
  .form-grid { grid-template-columns: 1fr; }

  /* "More" overflow sheet */
  .more-sheet {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(10,15,31,.5);
  }
  .more-sheet.open { display: block; }
  .more-panel {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--white); border-radius: 18px 18px 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom,0));
    box-shadow: 0 -8px 30px rgba(10,15,31,.25);
    animation: moreUp .22s ease;
  }
  @keyframes moreUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .more-grabber { width: 38px; height: 4px; border-radius: 999px; background: var(--gray); margin: 8px auto 12px; }
  .more-link {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 12px; border-radius: 12px;
    color: var(--navy); text-decoration: none; font-weight: 600; font-size: 15px;
  }
  .more-link.active { background: rgba(124,58,237,.10); color: var(--purple); }
  .more-link:active { background: rgba(10,15,31,.05); }
  .more-ic { font-size: 18px; width: 22px; text-align: center; }
  .more-link--upgrade { color: var(--purple); }
  .more-link--logout { color: var(--red); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 26px; }
  .pipeline-item, .contact-row { grid-template-columns: 1fr; }
  .pi-actions, .contact-actions { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
}

/* ── Utilities ── */
.text-muted { color: var(--muted); }
.text-purple { color: var(--purple); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hr { border: none; border-top: 1px solid var(--gray); margin: 20px 0; }

/* ── Follow-Up Message Assistant ─────────────────────────── */
.fa-overlay{position:fixed;inset:0;background:rgba(10,15,31,.55);display:none;align-items:center;justify-content:center;padding:20px;z-index:1000;}
.fa-overlay.open{display:flex;}
.fa-modal{background:var(--white);border-radius:var(--radius);box-shadow:var(--shadowM);width:100%;max-width:460px;padding:22px;}
.fa-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px;}
.fa-title{font-weight:700;font-size:18px;color:var(--navy);}
.fa-sub{color:var(--muted);font-size:13px;margin-top:2px;}
.fa-close{border:0;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:var(--muted);}
.fa-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;}
.fa-chip{border:1px solid var(--gray);background:var(--gray3);color:var(--body);border-radius:999px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;font-family:var(--font);}
.fa-chip.active{background:var(--purpleXL);border-color:var(--purpleL);color:var(--purpleD);}
.fa-textarea{width:100%;border:1px solid var(--gray);border-radius:var(--radiusS);padding:12px;font-family:var(--font);font-size:14px;color:var(--body);resize:vertical;box-sizing:border-box;}
.fa-textarea:focus{outline:none;border-color:var(--purpleL);box-shadow:0 0 0 3px var(--purpleXL);}
.fa-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap;}
.fa-disabled{opacity:.4;pointer-events:none;}
