/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --accent-dark: #1d4ed8;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --topbar-h: 56px;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  height: 100dvh;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea {
  font: inherit;
  color: var(--text);
}
img { display: block; max-width: 100%; }

/* ── Screens ───────────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; flex-direction: column; }

/* ── Auth ──────────────────────────────────────────────────────── */
.auth-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 40px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
}
.auth-logo { margin-bottom: 16px; }
.auth-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.auth-sub { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }
.auth-card { width: 100%; max-width: 400px; padding: 24px; }

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); background: #fff; }
.form-group textarea { resize: vertical; min-height: 70px; }

.search-input, .select-input {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px;
  outline: none;
  flex: 1;
  min-width: 0;
}
.search-input:focus, .select-input:focus { border-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); background: var(--accent-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.w-full { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background .15s;
}
.icon-btn:hover { background: var(--border); }

.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: var(--shadow-md);
  z-index: 100;
  transition: transform .15s;
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.95); }

/* ── Top Bar ───────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 4px; }

/* ── Bottom Nav ────────────────────────────────────────────────── */
.bottom-nav {
  height: calc(var(--nav-h) + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  padding-bottom: var(--safe-bottom);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
  padding-bottom: 2px;
}
.nav-btn.active { color: var(--accent); }
.nav-btn svg { transition: stroke .15s; }
.nav-btn.active svg { stroke: var(--accent); }

/* ── Main Content ──────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.tab-page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.tab-page.active { display: flex; }

/* ── Sub Nav ───────────────────────────────────────────────────── */
.sub-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Sub Pages ─────────────────────────────────────────────────── */
.sub-page {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sub-page.active { display: flex; }

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Toggle Group ──────────────────────────────────────────────── */
.toggle-group {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.toggle-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
}
.toggle-btn.active { background: var(--accent); color: #fff; }

/* ── Chip Row ──────────────────────────────────────────────────── */
.chip-row-wrap {
  position: relative;
  flex-shrink: 0;
}
.chip-row-wrap::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 10px;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}
.chip-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ── Feed / Lists ──────────────────────────────────────────────── */
.feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Member Grid ───────────────────────────────────────────────── */
.member-grid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
}
.member-card:active { transform: scale(.98); }
.member-card:hover { box-shadow: var(--shadow-md); }

.member-avatar {
  width: 54px; height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 600; margin-bottom: 1px; line-height: 1.3; word-break: break-word; }
.member-company { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; word-break: break-word; }
.member-skills { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
}
.role-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  margin-bottom: 4px;
}
.role-badge.super_admin { background: #fef3c7; color: #92400e; }
.role-badge.board { background: #dbeafe; color: #1e40af; }
.role-badge.member { background: var(--bg); color: var(--text-muted); }

/* ── Feed Cards ────────────────────────────────────────────────── */
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.feed-card:hover { box-shadow: var(--shadow-md); }
.feed-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.feed-card-meta { flex: 1; min-width: 0; }
.feed-card-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.feed-card-sub { font-size: 13px; color: var(--text-muted); }
.feed-card-body { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.feed-card-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-ask { background: #fce7f3; color: #9d174d; }
.badge-give { background: #dcfce7; color: #166534; }
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-fulfilled { background: var(--bg); color: var(--text-muted); }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* ── Avatar SM ─────────────────────────────────────────────────── */
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 32px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

/* ── Referral Leaderboard ──────────────────────────────────────── */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.lb-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lb-rank.gold { background: #fef3c7; color: #92400e; }
.lb-rank.silver { background: #f1f5f9; color: #475569; }
.lb-rank.bronze { background: #fff7ed; color: #9a3412; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; font-size: 14px; }
.lb-company { font-size: 12px; color: var(--text-muted); }
.lb-amount { font-weight: 700; font-size: 16px; color: var(--accent); }
.lb-count { font-size: 12px; color: var(--text-muted); }

/* ── Swipe Deck ────────────────────────────────────────────────── */
.swipe-deck {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px 16px 8px;
}
.swipe-card {
  position: absolute;
  width: calc(100% - 32px);
  max-width: 380px;
  height: calc(100% - 16px);
  max-height: 640px;
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
  overflow: hidden;
}
.swipe-card.dragging { cursor: grabbing; }
.swipe-card-cover {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  background-size: cover;
  background-position: center;
}
.swipe-card-cover::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
  pointer-events: none;
}
.swipe-card-info {
  position: relative;
  z-index: 2;
  padding: 16px 20px 20px;
}
.swipe-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: 0;
  z-index: 3;
}
.swipe-overlay-right { background: rgba(34,197,94,.5); color: #fff; }
.swipe-overlay-left  { background: rgba(239,68,68,.5); color: #fff; }
.swipe-overlay-up    { background: rgba(37,99,235,.5); color: #fff; }
.event-poster-date-badge {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.event-poster-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 8px;
}
.event-poster-meta { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 3px; }
.event-poster-footer { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.65); }
.swipe-hint-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 16px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  gap: 4px;
}
.swipe-hint-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.swipe-btn-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.swipe-hint-center {
  flex: 1;
  text-align: center;
}
.swipe-tinder-text {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: .01em;
}
.swipe-action-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all .15s;
}
.swipe-action-btn:active { transform: scale(.88); }
.swipe-btn-pass { border-color: var(--danger); color: var(--danger); font-size: 20px; font-weight: 700; }
.swipe-btn-pass:hover { background: #fee2e2; }
.swipe-btn-pi { border-color: var(--accent); }
.swipe-btn-pi:hover { background: var(--accent-light); }
.swipe-btn-interested { border-color: var(--success); }
.swipe-btn-interested:hover { background: #dcfce7; }

/* ── PI List ───────────────────────────────────────────────────── */
.pi-list { display: flex; flex-direction: column; gap: 8px; }
.pi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.pi-info { flex: 1; min-width: 0; }
.pi-name { font-size: 14px; font-weight: 600; }
.pi-sub { font-size: 12px; color: var(--text-muted); }

/* ── Past Events Grid ──────────────────────────────────────────── */
.events-past-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}
.past-event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.past-event-card:active { transform: scale(.97); }
.past-event-thumb {
  height: 90px;
  background: linear-gradient(135deg, #64748b, #334155);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px;
}
.past-event-photo-count {
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 99px;
}
.past-event-info { padding: 8px 10px 10px; }
.past-event-title { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.past-event-date { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── Calendar ──────────────────────────────────────────────────── */
.calendar-wrap { padding: 16px; }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-title { font-size: 17px; font-weight: 700; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
  text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: background .15s;
  padding: 2px;
}
.cal-day:hover { background: var(--accent-light); }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 700; }
.cal-day.has-event { background: var(--accent); color: #fff; font-weight: 700; border-radius: 50%; }
.cal-day.today.has-event { background: var(--accent); color: #fff; }
.cal-day.other-month { color: var(--text-light); }
.cal-day.other-month.has-event { background: var(--accent-light); color: var(--accent); opacity: .6; }
.cal-day.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day.has-event.selected { outline: 2px solid var(--accent-dark); outline-offset: -2px; }

#calendar-events-list { padding: 0 16px 16px; flex: 1; overflow-y: auto; }
.cal-event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.cal-event-card:hover { box-shadow: var(--shadow-md); }
.cal-event-title { font-weight: 600; font-size: 15px; }
.cal-event-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Event Detail ──────────────────────────────────────────────── */
.event-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 12px;
}
.event-photo-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg);
}
.event-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.interest-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.interest-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  transition: all .15s;
  cursor: pointer;
  min-width: 0;
}
.interest-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.interest-btn:active { transform: scale(.97); }

/* ── Admin Panel (inside modal) ────────────────────────────────── */
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-name { font-weight: 600; font-size: 14px; }
.admin-item-sub { font-size: 12px; color: var(--text-muted); }
.admin-item-actions { display: flex; gap: 6px; }

/* ── Profile Modal ─────────────────────────────────────────────── */
.profile-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-title { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.profile-company { font-size: 14px; color: var(--text); margin-top: 4px; }
.profile-section { margin-top: 14px; }
.profile-section h4 { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.skills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── QR Display ────────────────────────────────────────────────── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.qr-wrap img { border-radius: 8px; max-width: 260px; width: 100%; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 500;
  pointer-events: none;
  white-space: nowrap;
}
.toast.hidden { display: none; }

/* ── Utilities ─────────────────────────────────────────────────── */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Wall ──────────────────────────────────────────────────────── */
#ptr-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-48px);
  width: 36px;
  height: 36px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  font-size: 20px;
  color: var(--accent);
  pointer-events: none;
  will-change: transform;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }
#ptr-indicator.spinning #ptr-icon { animation: ptr-spin .7s linear infinite; }

.wall-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wall-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left-width: 4px;
  padding: 14px 14px 10px;
  box-shadow: var(--shadow);
}
.wall-post-pinned {
  border-left-color: #d97706 !important;
  background: #fffdf7;
}
.wall-pin-banner {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.wall-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.wall-post-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.wall-post-menu {
  font-size: 18px;
  color: var(--text-muted);
  padding: 0 6px;
  line-height: 1;
  border-radius: 4px;
}
.wall-post-menu:hover { background: var(--border); }
.wall-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wall-author-info { flex: 1; min-width: 0; }
.wall-author-name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.wall-author-meta { font-size: 12px; color: var(--text-muted); }
.wall-rec-tag {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-style: italic;
}
.wall-post-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 12px;
  word-break: break-word;
}
.wall-reactions {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
}
.reaction-btn span { font-size: 13px; font-weight: 600; }
.reaction-btn:active { transform: scale(.92); }
.reaction-btn.reacted { border-color: var(--accent); background: var(--accent-light); }
.wall-post-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.helped-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s;
}
.helped-btn:active { transform: scale(.95); }
.helped-btn.helped-active { color: var(--success); border-color: var(--success); background: #f0fdf4; }
.comment-toggle-btn {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.comment-toggle-btn:hover { background: var(--border); }
.wall-pin-btn { margin-left: auto; font-size: 12px; }

/* Comments */
.wall-comments-wrap { padding: 12px 0 4px; }
.comments-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item { display: flex; gap: 8px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; }
.comment-author { font-size: 13px; font-weight: 600; margin-right: 6px; }
.comment-text { font-size: 13px; line-height: 1.5; word-break: break-word; }
.comment-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.comment-input-wrap { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.comment-input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  outline: none;
}
.comment-input:focus { border-color: var(--accent); }

/* Compose */
.compose-types {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.compose-types::-webkit-scrollbar { display: none; }
.compose-type-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 20px;
  cursor: pointer;
  transition: all .15s;
  min-width: 56px;
}
.compose-type-btn:active { transform: scale(.93); }
.compose-type-label { font-size: 10px; font-weight: 600; color: inherit; }
.compose-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  outline: none;
  background: var(--bg);
}
.compose-textarea:focus { border-color: var(--accent); background: #fff; }

/* Nav dot */
.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-dot {
  position: absolute;
  top: -2px; right: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: none;
}
.nav-dot.visible { display: block; }

/* ── Empty State ───────────────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
  padding: 40px 20px;
}
.empty-state .emoji { font-size: 48px; }
.empty-state p { font-size: 15px; text-align: center; }

/* ── Spinner ───────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Attendance ────────────────────────────────────────────────── */
.attend-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.attend-actions .btn { flex: 1; min-width: 120px; }
#qr-scanner-wrap {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
#qr-scanner-wrap video {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ── Board Page ────────────────────────────────────────────────── */
.board-list { display: flex; flex-direction: column; gap: 10px; }
.board-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
}
.board-card-info { flex: 1; min-width: 0; }
.board-card-name { font-weight: 600; font-size: 15px; }
.board-card-leo-role { font-size: 13px; color: var(--accent); font-weight: 500; }
.board-card-company { font-size: 13px; color: var(--text-muted); }

/* ── Trusted Contact Card ──────────────────────────────────────── */
.tc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tc-card-name { font-weight: 600; font-size: 15px; }
.tc-card-company { font-size: 13px; color: var(--text-muted); margin: 2px 0 6px; }
.tc-card-rec { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 8px; }

/* ── Badges ────────────────────────────────────────────────────────── */
.member-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; justify-content: center; }
.badge-icon {
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: default;
  position: relative;
}
.badge-icon[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%; transform: translateX(-50%);
  background: #1e293b; color: white;
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; z-index: 200;
}
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.profile-badge-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

/* ── Skill post ────────────────────────────────────────────────────── */
.skill-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.skill-field-wrap label { font-size: 13px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 4px; }
.skill-field-wrap input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 15px; outline: none;
}
.skill-field-wrap input:focus { border-color: var(--accent); background: #fff; }
.skill-post-body { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.skill-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  font-size: 13px; font-weight: 500;
}
.skill-pill.learn { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.skill-interested-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: #25d366; color: white; font-weight: 600; font-size: 13px;
  margin-top: 6px; text-decoration: none;
}

/* ── Poll ──────────────────────────────────────────────────────────── */
.poll-wrap { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; overflow: hidden;
  transition: border-color .15s;
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.voted { border-color: var(--accent); color: var(--accent); }
.poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent-light); z-index: 0; transition: width .3s;
  border-radius: var(--radius-sm);
}
.poll-option span { position: relative; z-index: 1; }
.poll-option .poll-pct { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.poll-total { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.compose-poll-wrap { margin-top: 12px; }
.compose-poll-options { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.compose-poll-option {
  display: flex; align-items: center; gap: 6px;
}
.compose-poll-option input {
  flex: 1; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 14px; outline: none;
}
.compose-poll-option input:focus { border-color: var(--accent); }
.compose-poll-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.compose-poll-toggle input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Deal badge ────────────────────────────────────────────────────── */
.badge-deal { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.deal-expiry { font-size: 12px; color: var(--warn); font-weight: 500; }

/* ── Search ────────────────────────────────────────────────────────── */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; display: flex; flex-direction: column;
}
.search-panel {
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
  max-height: 85vh; display: flex; flex-direction: column;
}
.search-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.search-bar-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 24px; font: inherit; font-size: 15px; outline: none;
  background: var(--bg);
}
.search-bar-input:focus { border-color: var(--accent); }
.search-results { flex: 1; overflow-y: auto; padding: 8px 0; }
.search-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  padding: 10px 16px 4px;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer; transition: background .1s;
}
.search-result-item:hover { background: var(--bg); }
.search-result-name { font-weight: 600; font-size: 14px; }
.search-result-sub { font-size: 12px; color: var(--text-muted); }

/* ── WhatsApp sheet ────────────────────────────────────────────────── */
.wa-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 600;
  display: flex; align-items: flex-end;
}
.wa-sheet {
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; padding: 20px 20px calc(20px + var(--safe-bottom));
}
.wa-sheet-name { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.wa-sheet-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.wa-sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; border-radius: var(--radius-sm);
  background: #25d366; color: white; font-weight: 600; font-size: 15px;
  text-decoration: none;
}
.wa-btn-secondary {
  display: flex; align-items: center; justify-content: center;
  padding: 13px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer;
}

/* ── Member card canvas ────────────────────────────────────────────── */
.member-card-wrap { text-align: center; }
#member-card-canvas { border-radius: var(--radius); max-width: 100%; }
.member-card-download { margin-top: 12px; }

/* ── Coffee roulette toggle ────────────────────────────────────────── */
.coffee-toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--border); margin-top: 8px;
}
.coffee-toggle-label { font-size: 14px; font-weight: 600; }
.coffee-toggle-sub { font-size: 12px; color: var(--text-muted); }
.toggle-switch {
  position: relative; width: 44px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 24px; cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; left: 3px; top: 3px; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Member link (tappable name) ──────────────────────────────────── */
.member-link { cursor: pointer; font-weight: 600; }
.member-link:hover { text-decoration: underline; }

/* ── Topbar search btn ─────────────────────────────────────────────── */
.topbar-right { display: flex; align-items: center; gap: 2px; }

/* ── Self-RSVP buttons ─────────────────────────────────────────────── */
.rsvp-self-section { margin: 12px 0 4px; padding: 12px; background: var(--surface); border-radius: var(--radius-sm); border: 1.5px solid var(--border); }
.rsvp-self-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.rsvp-self-row { display: flex; gap: 8px; }
.rsvp-self-btn { flex: 1; padding: 9px 4px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--bg); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; text-align: center; }
.rsvp-self-btn:active { transform: scale(.96); }
.rsvp-self-btn.yes.active { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.rsvp-self-btn.maybe.active { background: #fef9c3; border-color: #ca8a04; color: #92400e; }
.rsvp-self-btn.no.active { background: #fee2e2; border-color: #dc2626; color: #991b1b; }

/* ── Call stats bar ────────────────────────────────────────────────── */
.call-stats-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.cs-stat { padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 700; background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; transition: opacity .12s, transform .1s; }
button.cs-stat:active { transform: scale(.93); opacity: .8; }
.cs-stat.yes { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.cs-stat.maybe { background: #fef9c3; border-color: #ca8a04; color: #92400e; }
.cs-stat.no { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.cs-stat.dnp { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.cs-stat.uncalled { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
.cs-stat.wa { background: #dcfce7; border-color: #25d366; color: #15803d; }

/* ── Calling screen overlay ────────────────────────────────────────── */
.calling-overlay { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.calling-panel { display: flex; flex-direction: column; height: 100%; max-width: 600px; width: 100%; margin: 0 auto; }
.calling-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.calling-title { flex: 1; min-width: 0; }
.calling-title-main { font-weight: 700; font-size: 15px; line-height: 1.2; }
.calling-title-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calling-stats { display: flex; gap: 6px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.calling-filters { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--bg); }
.calling-filters::-webkit-scrollbar { display: none; }
.calling-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom, 16px); }

/* ── Call list items ───────────────────────────────────────────────── */
.call-item { border-bottom: 1px solid var(--border); }
.call-item-body { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .1s; }
.call-item-body:active { background: var(--surface); }
.call-item-info { flex: 1; min-width: 0; }
.call-item-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.call-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.call-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.call-tel { color: var(--accent); text-decoration: none; }
.call-dial { font-size: 18px; text-decoration: none; }
.call-badge { padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.call-badge.yes { background: #dcfce7; color: #15803d; }
.call-badge.maybe { background: #fef9c3; color: #92400e; }
.call-badge.no { background: #fee2e2; color: #991b1b; }
.call-badge.dnp { background: #eff6ff; color: #1d4ed8; }
.call-badge.uncalled { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.call-badge.wa { background: #dcfce7; color: #15803d; }
.stub-pill { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 600; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); vertical-align: middle; }
.call-item-actions { display: flex; gap: 8px; padding: 8px 16px 12px; background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.call-status-btn { flex: 1; min-width: 64px; padding: 8px 4px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--bg); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; text-align: center; }
.call-status-btn:active { transform: scale(.96); }
.call-status-btn.yes:hover { background: #dcfce7; border-color: #16a34a; }
.call-status-btn.maybe:hover { background: #fef9c3; border-color: #ca8a04; }
.call-status-btn.no:hover { background: #fee2e2; border-color: #dc2626; }
.call-status-btn.dnp:hover { background: #eff6ff; border-color: #3b82f6; }
.call-wa-wrap { padding: 4px 16px 12px; background: var(--surface); }
.call-wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: #25d366; color: white; font-weight: 700; font-size: 14px; text-decoration: none; }
.call-group-hdr { padding: 6px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface); border-bottom: 1px solid var(--border); }
.call-unpresent-btn { padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; background: #dcfce7; border: 1.5px solid #16a34a; color: #15803d; cursor: pointer; white-space: nowrap; transition: opacity .15s; }
.call-unpresent-btn:hover { opacity: .75; }

/* ── Manage Events Tab ─────────────────────────────────────────────── */
.manage-event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.manage-event-card:active { transform: scale(.98); }
.manage-event-card:hover { box-shadow: var(--shadow-md); }
.manage-event-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.manage-event-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.manage-event-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.manage-role-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; background: #eff6ff; color: #1d4ed8; }
.manage-event-stats { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Notification Drawer ─────────────────────────────────────────── */
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid #fff;
}
.notif-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
}
.notif-overlay.open { display: block; }
.notif-drawer {
  position: fixed;
  top: 0; right: -110%;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bg);
  z-index: 301;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.18);
  transition: right .28s cubic-bezier(.4,0,.2,1);
}
.notif-drawer.open { right: 0; }
.notif-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.notif-item:active { background: var(--accent-light); }
.notif-item.notif-unread { background: #eff6ff; }
.notif-item-avatar {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.notif-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-item-text { font-size: 13px; color: var(--text-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.notif-type-pip {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ── @Mentions ──────────────────────────────────────────────────── */
.mention {
  display: inline;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.mention:active { opacity: .7; }
.mention-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  max-height: 240px;
  overflow-y: auto;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.mention-item:last-child { border-bottom: none; }
.mention-item:active { background: var(--accent-light); }
.mention-company { color: var(--text-muted); font-size: 12px; }

/* ── Admin Panel ─────────────────────────────────────────────────── */
.admin-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-topbar-title { font-weight: 700; font-size: 17px; }

.admin-tab-bar {
  display: flex; background: var(--surface);
  border-bottom: 2px solid var(--border); flex-shrink: 0; overflow-x: auto;
  scrollbar-width: none;
}
.admin-tab-bar::-webkit-scrollbar { display: none; }
.admin-tab-btn {
  flex: 1; padding: 13px 10px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; white-space: nowrap; transition: color .15s;
}
.admin-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-content { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg); }

/* toolbar */
.admin-toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.admin-search-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; background: var(--bg);
  color: var(--text); font-size: 14px;
}
.admin-search-input:focus { outline: none; border-color: var(--accent); }
.admin-filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.admin-filter-row::-webkit-scrollbar { display: none; }
.admin-filter-chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--bg); border: 1.5px solid var(--border); color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all .15s; display: flex; align-items: center; gap: 4px;
}
.admin-filter-chip-active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.admin-chip-count {
  background: var(--accent); color: white; border-radius: 999px;
  font-size: 10px; font-weight: 700; padding: 1px 5px;
}
.admin-filter-chip-active .admin-chip-count { background: var(--accent-dark); }

/* member rows */
.admin-member-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.admin-member-row:active { background: var(--accent-light); }
.admin-member-info { flex: 1; min-width: 0; }
.admin-member-name { font-weight: 600; font-size: 14px; }
.admin-member-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.admin-member-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.admin-member-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* tags */
.admin-tag {
  display: inline-block; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid transparent;
}
.admin-tag-active   { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.admin-tag-pending  { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.admin-tag-stub     { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
.admin-tag-inactive { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.admin-tag-warn     { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.admin-tag-danger   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.admin-tag-muted    { background: var(--bg); color: var(--text-muted); border-color: var(--border); }

/* stats */
.admin-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; text-align: center;
  box-shadow: var(--shadow);
}
.stat-warn-card  { border-left: 3px solid var(--warn); }
.stat-danger-card { border-left: 3px solid var(--danger); }
.stat-num { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-lbl { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* watch matrix */
.wm-legend {
  padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.wm-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  /* leave room above topbar + tabs + legend */
}
.wm-table { border-collapse: collapse; font-size: 12px; }
.wm-table th, .wm-table td { border: 1px solid var(--border); padding: 0; }
.wm-name-col {
  position: sticky; left: 0; background: var(--surface); z-index: 2;
  padding: 8px 10px; font-size: 12px; font-weight: 600;
  min-width: 130px; max-width: 150px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; text-align: left;
}
.wm-table thead th.wm-name-col { z-index: 3; background: var(--bg); }
.wm-event-th {
  padding: 6px 4px; background: var(--bg); position: sticky; top: 0; z-index: 1;
  min-width: 52px; max-width: 64px;
}
.wm-event-label { font-size: 10px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-event-date  { font-size: 10px; color: var(--text-muted); }
.wm-cell { text-align: center; padding: 7px 4px; font-size: 11px; font-weight: 700; min-width: 38px; }
.wm-pi      { background: #dbeafe; color: #1d4ed8; }
.wm-present { background: #dcfce7; color: #166534; }
.wm-absent  { background: #fee2e2; color: #991b1b; }
.wm-na      { color: var(--text-light); }
