/* ══════════════════════════════════════════
   FriendSync — Custom Bootstrap Theme
   Monochrome + teal accent, mobile-first
   ══════════════════════════════════════════ */

:root {
  --fs-accent: #00BFA6;
  --fs-accent-dark: #00897B;
  --fs-accent-subtle: #E8F8F5;
  --fs-danger: #DC3545;
  --fs-danger-subtle: #FDEDEC;
  --fs-warn: #F39C12;
  --fs-warn-subtle: #FEF5E7;
  --fs-purple: #8E44AD;
  --fs-purple-subtle: #F4ECF7;
  --fs-bg: #F8F9FA;
  --fs-surface: #FFFFFF;
  --fs-text: #1A1A1A;
  --fs-muted: #6C757D;
  --fs-border: #E9ECEF;
  --fs-border-light: #F1F3F5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--fs-bg);
  color: var(--fs-text);
}

/* ── App Shell ── */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--fs-bg);
  position: relative;
  padding-bottom: 72px;
}
@media (min-width: 768px) {
  .app-shell {
    box-shadow: 0 0 40px rgba(0,0,0,0.06);
    border-left: 1px solid var(--fs-border);
    border-right: 1px solid var(--fs-border);
  }
}

/* ── Top Bar ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--fs-surface);
  border-bottom: 1px solid var(--fs-border);
  padding: 14px 20px;
}
.top-bar h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px; margin: 0; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--fs-border); background: var(--fs-surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fs-text); font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--fs-bg); color: var(--fs-text); }

/* ── Search ── */
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--fs-muted); font-size: 13px; pointer-events: none; }
.search-input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 10px;
  border: 1px solid var(--fs-border); background: var(--fs-bg);
  font-size: 14px; outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--fs-text); box-shadow: none; }

/* ── Cards ── */
.card-fs {
  background: var(--fs-surface); border: 1px solid var(--fs-border);
  border-radius: 12px; overflow: hidden;
}

/* ── Avatars ── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 14px; }
.avatar-lg { width: 68px; height: 68px; font-size: 26px; }
.av-dark { background: #2C3E50; }
.av-slate { background: #5D6D7E; }
.av-charcoal { background: #34495E; }
.av-graphite { background: #616A6B; }
.av-steel { background: #7F8C8D; }
.av-ink { background: #1B2631; }
.av-ash { background: #566573; }
.av-accent { background: var(--fs-accent); }

/* ── List Rows ── */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--fs-border-light);
  text-decoration: none; color: inherit; transition: background 0.1s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--fs-bg); color: inherit; text-decoration: none; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .name { font-weight: 600; font-size: 15px; }
.list-row .sub { font-size: 12px; color: var(--fs-muted); margin-top: 1px; }

/* ── Badges ── */
.badge-fs {
  font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 700;
  white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; display: inline-block;
}
.badge-overdue { background: var(--fs-danger-subtle); color: var(--fs-danger); }
.badge-due { background: var(--fs-warn-subtle); color: var(--fs-warn); }
.badge-ok { background: var(--fs-accent-subtle); color: var(--fs-accent-dark); }
.badge-snoozed { background: var(--fs-purple-subtle); color: var(--fs-purple); }

/* ── Action Buttons ── */
.action-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--fs-border); background: var(--fs-surface);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; color: var(--fs-muted); padding: 0;
  transition: all 0.15s; flex-shrink: 0;
}
.action-btn:hover { background: var(--fs-bg); }
.action-btn.accent { border-color: var(--fs-accent); color: var(--fs-accent); }
.action-btn.accent:hover { background: var(--fs-accent-subtle); }

/* ── Filter Pills ── */
.pill-scroll { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pill-scroll::-webkit-scrollbar { display: none; }
.pill-fs {
  padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--fs-border); background: var(--fs-surface); color: var(--fs-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.15s; text-decoration: none; display: inline-block;
}
.pill-fs:hover:not(.active) { border-color: var(--fs-muted); color: var(--fs-muted); text-decoration: none; }
.pill-fs.active { background: var(--fs-text); color: #fff; border-color: var(--fs-text); }
.pill-fs.active:hover { color: #fff; text-decoration: none; }

/* ── Sections ── */
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fs-muted); padding: 16px 20px 6px; }
.section-header { padding: 16px 20px 6px; }
.section-header h2 { font-size: 1rem; font-weight: 700; margin: 0; }

/* ── Stats ── */
.stat-card { flex: 1; background: var(--fs-surface); border: 1px solid var(--fs-border); border-radius: 12px; padding: 14px 12px; text-align: center; }
.stat-card .number { font-size: 1.5rem; font-weight: 800; }
.stat-card .label { font-size: 10px; color: var(--fs-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.stat-card.danger .number { color: var(--fs-danger); }
.stat-card.accent .number { color: var(--fs-accent); }

/* ── Quick Actions ── */
.quick-action {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 12px; background: var(--fs-surface);
  border: 1px solid var(--fs-border); cursor: pointer; text-decoration: none; color: inherit;
  transition: all 0.15s;
}
.quick-action i { font-size: 18px; color: var(--fs-text); }
.quick-action span { font-size: 10px; font-weight: 600; color: var(--fs-muted); }
.quick-action:hover { background: var(--fs-bg); color: inherit; text-decoration: none; }

/* ── Activity Icon ── */
.activity-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; background: var(--fs-bg); color: var(--fs-text);
}
.activity-icon-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 28px; }

/* ── Birthday ── */
.bday-date { text-align: center; min-width: 40px; flex-shrink: 0; }
.bday-date .day { font-size: 18px; font-weight: 800; line-height: 1; }
.bday-date .month { font-size: 10px; color: var(--fs-muted); text-transform: uppercase; font-weight: 600; }

/* ── Detail Header ── */
.detail-header { text-align: center; padding: 28px 20px 16px; }
.detail-header .name { font-size: 22px; font-weight: 800; margin: 0; }
.detail-header .location { font-size: 13px; color: var(--fs-muted); margin-top: 4px; }
.tz-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--fs-bg); border: 1px solid var(--fs-border);
  padding: 4px 12px; border-radius: 20px; margin-top: 10px; color: var(--fs-muted); font-weight: 600;
}

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
  background: var(--fs-bg); border: 1px solid var(--fs-border); color: var(--fs-text);
}
.chip i { font-size: 11px; color: var(--fs-muted); }

/* ── Meta ── */
.snooze-info { font-size: 11px; color: var(--fs-purple); font-weight: 600; }
.catchup-meta { font-size: 12px; color: var(--fs-danger); font-weight: 600; margin-top: 2px; }
.preferred-tag {
  font-size: 9px; background: var(--fs-accent-subtle); color: var(--fs-accent-dark);
  padding: 2px 6px; border-radius: 6px; font-weight: 700; text-transform: uppercase;
  margin-left: 6px; letter-spacing: 0.3px;
}

/* ── Timeline ── */
.timeline-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--fs-border-light); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; background: var(--fs-bg); border: 1px solid var(--fs-border); color: var(--fs-text);
}
.timeline-body { flex: 1; }
.timeline-body .title { font-weight: 600; font-size: 14px; }
.timeline-body .date { font-size: 11px; color: var(--fs-muted); margin-top: 1px; }
.timeline-body .note { font-size: 13px; color: var(--fs-muted); margin-top: 4px; line-height: 1.4; }

/* ── Notes ── */
.note-entry { padding: 12px 16px; border-bottom: 1px solid var(--fs-border-light); }
.note-entry:last-child { border-bottom: none; }
.note-date { font-size: 11px; color: var(--fs-muted); font-weight: 600; }
.note-text { font-size: 13px; margin-top: 4px; line-height: 1.5; }

/* ── Forms ── */
.form-label-fs { font-size: 11px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.form-control-fs {
  border: 1px solid var(--fs-border); border-radius: 10px; padding: 10px 14px;
  font-size: 15px; background: var(--fs-surface); width: 100%; outline: none; transition: border-color 0.15s;
}
.form-control-fs:focus { border-color: var(--fs-text); box-shadow: none; }
select.form-control-fs { appearance: auto; }
textarea.form-control-fs { resize: none; }

/* ── Freq Grid ── */
.freq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.freq-opt {
  padding: 10px; border: 1px solid var(--fs-border); border-radius: 10px;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--fs-muted); cursor: pointer;
}
.freq-opt:has(input:checked) { border-color: var(--fs-text); background: var(--fs-text); color: #fff; }
.freq-opt input[type="radio"] { display: none; }

/* ── Buttons ── */
.btn-fs {
  padding: 12px 20px; border-radius: 10px; font-size: 15px; font-weight: 700;
  border: none; cursor: pointer; width: 100%; display: block; text-align: center;
  text-decoration: none; transition: opacity 0.15s;
}
.btn-fs:active { opacity: 0.8; }
.btn-fs-primary { background: var(--fs-text); color: #fff; }
.btn-fs-primary:hover { color: #fff; opacity: 0.9; }
.btn-fs-outline { background: var(--fs-surface); color: var(--fs-text); border: 1px solid var(--fs-border); }
.btn-fs-outline:hover { color: var(--fs-text); background: var(--fs-bg); }
.btn-fs-danger { background: var(--fs-danger-subtle); color: var(--fs-danger); }
.btn-fs-danger:hover { color: var(--fs-danger); }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--fs-surface);
  border-top: 1px solid var(--fs-border); z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav .nav-link {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 0 4px; color: var(--fs-muted); font-size: 10px;
  font-weight: 600; text-decoration: none; transition: color 0.15s;
}
.bottom-nav .nav-link i { font-size: 18px; }
.bottom-nav .nav-link.active { color: var(--fs-text); }

/* ── Flash ── */
.flash-notice { padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--fs-accent-subtle); color: var(--fs-accent-dark); border: 1px solid #B2DFDB; }
.flash-error { background: var(--fs-danger-subtle); color: var(--fs-danger); border: 1px solid #F5C6CB; }

/* ── Location ── */
.country-header { font-size: 11px; font-weight: 700; color: var(--fs-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 16px 6px; display: flex; align-items: center; gap: 8px; }
.count-badge { background: var(--fs-text); color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 10px; font-weight: 700; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 48px 32px; color: var(--fs-muted); }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; margin: 0; }

/* ── Utility ── */
.text-accent { color: var(--fs-accent) !important; }
.fs-muted { color: var(--fs-muted); }
