/* ============================================================
   Erika Donor Tracker — Campaign Tool CSS
   MOBILE-FIRST. Designed for a phone in one hand.
   PYRIG-UX v1.0 audit applied.
   ============================================================ */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --border: #e5e5e4;
  --text: #1c1917;
  --text-secondary: #78716c;
  --text-tertiary: #a8a29e;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --red: #dc2626;
  --red-light: #fef2f2;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", monospace;
  --tap-min: 44px; /* Apple HIG minimum touch target */
}

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

/* UX-7.1 FIX: Global focus-visible styles */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ────────────────────────────────────── */

.topnav {
  background: var(--text);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-brand {
  color: white;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.topnav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

/* UX-3.3 FIX: Taller search input */
.topnav-search input {
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 15px;
  outline: none;
  min-height: var(--tap-min);
}

.topnav-search input::placeholder { color: rgba(255,255,255,0.5); }
.topnav-search input:focus { background: rgba(255,255,255,0.25); }

.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  margin-top: 4px;
  overflow: hidden;
  z-index: 200;
}

/* UX-3.x: Larger tap targets on search results */
.search-item {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  min-height: var(--tap-min);
}

.search-item:last-child { border-bottom: none; }
.search-item:hover, .search-item:active { background: var(--accent-light); }
.search-name { font-weight: 600; }
.search-meta { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.search-empty { color: var(--text-tertiary); font-style: italic; }

.topnav-links {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.topnav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius);
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}

.topnav-links a:hover, .topnav-links a.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* ── Mobile Nav ─────────────────────────────── */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}

/* UX-4.4 FIX: Bottom tab bar on mobile instead of hamburger */
@media (max-width: 768px) {
  .topnav-links { display: none; }
  .nav-toggle { display: none; } /* We replace hamburger with bottom tabs */

  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 4px 0;
    padding-bottom: env(safe-area-inset-bottom, 4px);
  }

  .bottom-tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
    min-height: var(--tap-min);
    justify-content: center;
  }

  .bottom-tabs a.active { color: var(--accent); }
  .bottom-tabs a .tab-icon { font-size: 20px; }
  .bottom-tabs a .tab-label { line-height: 1; }

  /* Account for bottom tabs */
  body { padding-bottom: 70px; }

  /* Keep desktop nav links hidden */
  .topnav { gap: 8px; padding: 0 12px; }
}

@media (min-width: 769px) {
  .bottom-tabs { display: none; }
}

.nav-calltime {
  background: var(--green) !important;
  color: white !important;
  border-radius: var(--radius);
  font-weight: 600;
}

/* ── Container ──────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}

.container-narrow { max-width: 600px; }

/* ── Cards ──────────────────────────────────── */

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

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap-min);
}

.card-body { padding: 0; }
.card-body-padded { padding: 16px; }

/* ── Collapsible Cards (UX-R5) ──────────────── */

.card-collapsible .card-header {
  cursor: pointer;
  user-select: none;
}

.card-collapsible .card-header::after {
  content: "▼";
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.card-collapsible.collapsed .card-header::after {
  transform: rotate(-90deg);
}

.card-collapsible.collapsed .card-body,
.card-collapsible.collapsed .card-body-padded {
  display: none;
}

/* ── Stats Bar ──────────────────────────────── */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.stat-green .stat-value { color: var(--green); }

/* ── Lists ──────────────────────────────────── */

.donor-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  gap: 10px;
  transition: background 0.1s;
  min-height: var(--tap-min);
}

.donor-row:last-child { border-bottom: none; }
.donor-row:hover, .donor-row:active { background: var(--accent-light); }

/* UX-7.2 FIX: Priority dots with text labels */
.donor-priority {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.priority-4 { background: var(--red); }
.priority-3 { background: var(--amber); }
.priority-2 { background: var(--accent); }
.priority-1 { background: var(--text-tertiary); }
.priority-0 { background: transparent; border: 1.5px solid var(--border); }

/* Colorblind-accessible: add shape variation */
.priority-4::after { content: "!"; position: absolute; top: -2px; left: 2px; font-size: 8px; font-weight: 900; color: white; }

.donor-info { flex: 1; min-width: 0; }

.donor-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donor-meta {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donor-amount {
  font-weight: 700;
  font-size: 15px;
  font-family: var(--mono);
  flex-shrink: 0;
  text-align: right;
}

.donor-amount-erika { color: var(--green); }

/* ── Donation Feed ──────────────────────────── */

.donation-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  min-height: var(--tap-min);
}

.donation-row:last-child { border-bottom: none; }

.donation-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.badge-new { background: var(--green-light); color: var(--green); }
.badge-repeat { background: var(--accent-light); color: var(--accent); }
.badge-lapsed { background: var(--amber-light); color: var(--amber); }
.badge-maxed { background: var(--purple-light); color: var(--purple); }

/* ── Status Badges ──────────────────────────── */

.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-active { background: var(--green-light); color: var(--green); }
.status-prospect { background: var(--accent-light); color: var(--accent); }
.status-lapsed { background: var(--amber-light); color: var(--amber); }
.status-maxed { background: var(--purple-light); color: var(--purple); }
.status-declined { background: var(--red-light); color: var(--red); }

/* ── Task Items ─────────────────────────────── */

.task-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  min-height: var(--tap-min);
}

.task-item:last-child { border-bottom: none; }
.task-overdue { background: var(--red-light); }

/* UX-3.1 FIX: 44px touch target for task complete */
.task-complete-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: 2px solid var(--border);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-complete-btn:hover, .task-complete-btn:active {
  border-color: var(--green);
  background: var(--green-light);
}

.task-info { flex: 1; }
.task-title { font-size: 14px; }
.task-due { font-size: 12px; color: var(--text-secondary); }
.task-due-overdue { color: var(--red); font-weight: 600; }

/* ── Donor Detail ───────────────────────────── */

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.detail-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

.detail-contact {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.detail-contact a { color: var(--accent); text-decoration: none; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

/* UX-3.2 FIX: 44px priority buttons */
.priority-selector {
  display: flex;
  gap: 6px;
}

.priority-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.priority-btn.active { border-width: 3px; }
.priority-btn[data-priority="4"] { border-color: var(--red); }
.priority-btn[data-priority="4"].active { background: var(--red-light); }
.priority-btn[data-priority="3"] { border-color: var(--amber); }
.priority-btn[data-priority="3"].active { background: var(--amber-light); }
.priority-btn[data-priority="2"] { border-color: var(--accent); }
.priority-btn[data-priority="2"].active { background: var(--accent-light); }

/* ── Forms ──────────────────────────────────── */

.form-row { margin-bottom: 10px; }

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text-secondary);
}

textarea, input[type="text"], input[type="date"], input[type="email"],
input[type="number"], input[type="password"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px; /* Prevents iOS zoom on focus */
  background: var(--surface);
  color: var(--text);
  min-height: var(--tap-min);
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

textarea { resize: vertical; min-height: 80px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s;
  min-height: var(--tap-min);
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #15803d; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }

/* UX-8.2 FIX: Disabled state for double-submit prevention */
.btn:disabled, .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Filters ────────────────────────────────── */

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}

.filters select, .filters input {
  width: auto;
  min-width: 110px;
  padding: 8px 10px;
  font-size: 14px;
  min-height: 40px;
}

.filters input[type="text"] { min-width: 180px; }

/* UX-3.4 FIX: Larger filter checkboxes */
.filter-check {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 40px;
}

.filter-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ── Pagination ─────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}

.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  color: var(--text-secondary);
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}

.pagination a:hover { background: var(--accent-light); color: var(--accent); }
.pagination .current { background: var(--accent); color: white; font-weight: 600; }

/* ── Notes ──────────────────────────────────── */

.note-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: none; }
.note-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }

/* ── Import ─────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  min-height: 120px;
}

.upload-zone:active { border-color: var(--accent); background: var(--accent-light); }

.import-log-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

.import-log-row:last-child { border-bottom: none; }

/* ── Login ──────────────────────────────────── */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

/* ── Utility ────────────────────────────────── */

.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-mono { font-family: var(--mono); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.issue-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  margin: 2px;
}

.messages { padding: 0 16px; }
.msg { padding: 12px 16px; margin: 8px 0; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.msg-success { background: var(--green-light); color: var(--green); }
.msg-error { background: var(--red-light); color: var(--red); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-phone {
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sync-indicator {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════
   CALL TIME — UX-2.2 FIX: Sticky bottom log form
   ═══════════════════════════════════════════════ */

/* ── Queue modes ─────────────────────────────── */

.queue-modes {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.queue-mode-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.queue-mode-btn:hover { background: var(--bg); }
.queue-mode-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Call time layout ────────────────────────── */

.calltime-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.calltime-empty h2 { font-size: 22px; color: var(--text); }

.calltime-queue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

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

.calltime-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.calltime-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.calltime-badges { display: flex; gap: 6px; margin-top: 4px; }

/* Phone button: huge, tappable */
.calltime-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--green-light);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  margin-bottom: 14px;
  justify-content: center;
  min-height: 56px;
}

.calltime-phone:active { background: #dcfce7; }

.calltime-phone-missing {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-tertiary);
  font-size: 15px;
  font-weight: 400;
}

.calltime-phone-missing a { color: var(--accent); }

.calltime-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.calltime-info-item {
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
}

.calltime-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.calltime-info-value {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--mono);
}

.calltime-context {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.calltime-issues { margin-bottom: 10px; }

.calltime-last-gift {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius);
}

.calltime-notes { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.calltime-notes-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 6px; }

.calltime-note { padding: 4px 0; border-bottom: 1px solid var(--border); }
.calltime-note:last-child { border-bottom: none; }

.calltime-remove {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* ── UX-8.1: Sticky bottom log form ─────────── */

.calltime-log {
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 16px;
}

/* Mobile: fixed bottom sheet */
@media (max-width: 768px) {
  .calltime-page { padding-bottom: 0; }

  .calltime-log {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    border-radius: 12px 12px 0 0;
    border-top: 2px solid var(--border);
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(calc(100% - 56px));
    transition: transform 0.25s ease;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  .calltime-log.open {
    transform: translateY(0);
  }

  .calltime-log-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    min-height: 56px;
    gap: 8px;
  }

  .calltime-log-handle::before {
    content: "";
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
  }

  .calltime-log-inner {
    padding: 0;
  }

  /* Give space for the peek handle */
  .calltime-card { margin-bottom: 72px; }
}

/* Desktop: side panel */
@media (min-width: 769px) {
  .calltime-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
  }

  .calltime-log {
    position: sticky;
    top: 72px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .calltime-log-handle { display: none; }
}

.calltime-log-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* UX-R6: Grouped result buttons */
.calltime-results-group {
  margin-bottom: 10px;
}

.calltime-results-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.calltime-results-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.calltime-results-row.four-col {
  grid-template-columns: repeat(4, 1fr);
}

.result-btn { cursor: pointer; text-align: center; }
.result-btn input { display: none; }

.result-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.1s;
  min-height: var(--tap-min);
}

.result-btn input:checked + span {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.calltime-followup { margin-top: 10px; }

.calltime-followup-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  min-height: var(--tap-min);
}

.calltime-followup-fields {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.calltime-followup-fields input { flex: 1; }

.calltime-actions { margin-top: 12px; }

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
  width: 100%;
  min-height: 52px;
}

@media (max-width: 480px) {
  .calltime-results-row { grid-template-columns: repeat(3, 1fr); }
  .calltime-results-row.four-col { grid-template-columns: repeat(2, 1fr); }
  .calltime-followup-fields { flex-direction: column; }
}

/* ── Interaction Type Selector ──────────────── */

.interaction-types {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.itype-btn { cursor: pointer; }
.itype-btn input { display: none; }

.itype-btn span {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  min-height: 38px;
}

.itype-btn input:checked + span {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* ── Timeline ───────────────────────────────── */

.timeline-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.timeline-content { flex: 1; min-width: 0; }
.timeline-date { font-size: 12px; color: var(--text-tertiary); margin-bottom: 1px; }
.timeline-main { font-size: 14px; line-height: 1.5; }
.timeline-text { white-space: pre-wrap; margin-top: 2px; color: var(--text); }

/* ── Bulk Actions ───────────────────────────── */

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  position: sticky;
  top: 52px;
  z-index: 90;
}

.donor-row-selectable { cursor: pointer; }
.donor-row-selectable:has(input:checked) { background: var(--accent-light); }

.donor-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ── Call Time CTA ──────────────────────────── */

.calltime-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--green);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  margin-bottom: 16px;
  min-height: 56px;
}

.calltime-cta:hover, .calltime-cta:active { background: #15803d; }
.calltime-cta-icon { font-size: 24px; }
.calltime-cta-text { flex: 1; }
.calltime-cta-text strong { display: block; font-size: 16px; }
.calltime-cta-text span { font-size: 13px; opacity: 0.85; }
.calltime-cta-arrow { font-size: 20px; opacity: 0.7; }

/* ── Goal Progress ──────────────────────────── */

.goal-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.goal-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 4px;
}

.goal-bar-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
}

.goal-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.goal-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.5s ease; min-width: 2px; }

/* ── Activity Summary ───────────────────────── */

.activity-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

.activity-summary > span:first-child { font-weight: 600; color: var(--text-secondary); }
.activity-chip { padding: 3px 10px; background: var(--bg); border-radius: 12px; font-size: 12px; }

/* ── Mobile form layout fixes ───────────────── */

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.form-grid-donation { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 480px) {
  .form-grid-2, .form-grid-3, .form-grid-donation { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .detail-header { flex-direction: column; }
  .detail-name { font-size: 20px; }
  .container { padding: 16px 12px; }
  .stats-bar { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .filters { gap: 6px; }
  .filters select, .filters input { width: 100%; min-width: 0; }
  .donor-row { padding: 10px 12px; }
}

/* ── PYRIG-UX R2 Fixes ─────────────────────── */

/* UX-R2.A: Hide bottom tabs during call time */
@media (max-width: 768px) {
  .calltime-page { padding-bottom: 0 !important; }
  .calltime-page ~ .bottom-tabs { display: none; }
}
/* Fallback: body class approach for templates that use container class */
body:has(.calltime-page) .bottom-tabs { display: none; }
body:has(.calltime-page) { padding-bottom: 0 !important; }

/* UX-R2.C: Larger textarea in call-time sheet */
.calltime-log textarea {
  min-height: 60px;
}
.calltime-log textarea:focus {
  min-height: 80px;
}

/* ── Note edit/delete actions ───────────────── */

.timeline-note-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.timeline-note-actions a,
.timeline-note-actions button {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: underline;
}

.timeline-note-actions a:hover,
.timeline-note-actions button:hover {
  color: var(--text-secondary);
}
