/* ══════════════════════════════════════════════════════════════════
   Bondal Family Platform — Design System
   LinkedIn-premium aesthetic: clean whites, forest green brand,
   refined typography, smooth interactions
══════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ──────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:       #1a6b4a;
  --brand-dark:  #15573c;
  --brand-light: #e8f4ef;
  --brand-mid:   #b3d9c8;
  --brand-text:  #0e4530;

  /* Neutral palette */
  --ink:         #0a0a0a;
  --ink-2:       #1c1c1c;
  --mid:         #5f6368;
  --subtle:      #9aa0a6;
  --ghost:       #c4c9ce;

  /* Surfaces */
  --white:       #ffffff;
  --surface:     #f3f6f9;
  --surface-2:   #edf1f5;
  --border:      #dde2e8;
  --border-2:    #c8d0d8;

  /* Semantic */
  --success:     #27ae60;
  --success-bg:  #e9f7ef;
  --warn:        #f39c12;
  --warn-bg:     #fef9e7;
  --danger:      #e74c3c;
  --danger-bg:   #fdecea;
  --info:        #2980b9;
  --info-bg:     #ebf5fb;
  --gold:        #c8963a;
  --gold-bg:     #fdf5e6;

  /* Typography */
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --text-xs:  11px;
  --text-sm:  12px;
  --text-base:13px;
  --text-md:  14px;
  --text-lg:  16px;
  --text-xl:  18px;
  --text-2xl: 22px;
  --text-3xl: 28px;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;

  /* Layout */
  --nav-h:    56px;
  --max-feed: 680px;
  --max-wide: 1060px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);

  /* Transitions */
  --t-fast:   0.12s ease;
  --t-base:   0.18s ease;
  --t-slow:   0.28s ease;
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── NAVIGATION — Apple style ───────────────────────────── */
.nav{height:48px;background:rgba(245,245,247,.92);backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid rgba(0,0,0,.1);position:sticky;top:0;z-index:200;}
.nav__inner{max-width:1080px;margin:0 auto;height:100%;display:flex;align-items:center;gap:8px;padding:0 20px;}
.nav__brand{display:flex;align-items:center;gap:7px;font-size:15px;font-weight:600;color:#1d1d1f;text-decoration:none;flex-shrink:0;letter-spacing:-.3px;}
.nav__brand span{color:#1a6b4a;}
.nav__brand:hover{opacity:.75;text-decoration:none;}
.nav__search{position:relative;flex:0 1 220px;display:flex;align-items:center;}
.nav__search-input{width:100%;padding:6px 30px 6px 12px;background:rgba(0,0,0,.07);border:none;border-radius:20px;font-size:13px;color:#1d1d1f;transition:all .2s;font-family:inherit;}
.nav__search-input::placeholder{color:#86868b;}
.nav__search-input:focus{background:rgba(0,0,0,.1);outline:none;box-shadow:0 0 0 3px rgba(26,107,74,.18);}
.nav__search-btn{position:absolute;right:8px;background:none;border:none;color:#86868b;display:flex;align-items:center;padding:3px;}
.nav__search-btn:hover{color:#1d1d1f;}
.nav__links{display:flex;gap:0;flex:1;justify-content:center;}
.nav__link{display:flex;align-items:center;gap:5px;padding:5px 11px;border-radius:6px;font-size:13px;font-weight:500;color:#424245;text-decoration:none;transition:all .12s;white-space:nowrap;}
.nav__link svg{width:16px;height:16px;flex-shrink:0;}
.nav__link:hover{color:#1d1d1f;background:rgba(0,0,0,.06);text-decoration:none;}
.nav__link--on{color:#1a6b4a;background:rgba(26,107,74,.09);font-weight:600;}
.nav__link--on svg{color:#1a6b4a;}
/* Push profile/actions to far right */
.nav__actions{display:flex;align-items:center;gap:2px;flex-shrink:0;margin-left:auto;}
.nav__action-btn{position:relative;width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#424245;background:rgba(255,255,255,0.50);border:1px solid rgba(255,255,255,0.72);box-shadow:0 1px 4px rgba(0,0,0,0.07);transition:all .15s;}
.nav__action-btn:hover{background:rgba(255,255,255,0.80);box-shadow:0 2px 8px rgba(0,0,0,0.10);color:#1d1d1f;}
.nav__badge{position:absolute;top:2px;right:2px;min-width:15px;height:15px;background:#ff3b30;color:#fff;border-radius:999px;font-size:8.5px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 3px;border:1.5px solid rgba(248,249,252,0.92);box-shadow:0 1px 4px rgba(255,59,48,0.35);}
.nav__profile{position:relative;}
.nav__profile-btn{display:flex;align-items:center;gap:5px;padding:3px 8px 3px 3px;border-radius:999px;border:1px solid rgba(255,255,255,0.72);background:rgba(255,255,255,0.50);cursor:pointer;transition:all .15s;color:#424245;box-shadow:0 1px 4px rgba(0,0,0,0.07);}
.nav__profile-btn:hover{background:rgba(255,255,255,0.80);box-shadow:0 2px 8px rgba(0,0,0,0.10);}
.nav__avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#1a6b4a,#0e4530);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0;border:1.5px solid rgba(255,255,255,0.80);}
.nav__avatar-img{width:28px;height:28px;border-radius:50%;object-fit:cover;border:1.5px solid rgba(255,255,255,0.80);}
/* Liquid glass dropdown */
.nav__dropdown{position:absolute;top:calc(100% + 8px);right:0;min-width:210px;background:rgba(248,249,252,0.94);backdrop-filter:saturate(200%) blur(32px);-webkit-backdrop-filter:saturate(200%) blur(32px);border:1px solid rgba(255,255,255,0.75);border-radius:16px;box-shadow:0 8px 40px rgba(0,0,0,0.13),0 1px 0 rgba(255,255,255,0.88) inset;z-index:300;overflow:hidden;animation:dropIn .15s ease;}
@keyframes dropIn{from{opacity:0;transform:translateY(-8px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.nav__dropdown-head{padding:13px 15px;border-bottom:1px solid rgba(255,255,255,0.60);display:flex;flex-direction:column;gap:2px;background:rgba(255,255,255,0.30);}
.nav__dropdown-head strong{font-size:13px;color:#1d1d1f;font-weight:600;}
.nav__dropdown-head span{font-size:11px;color:#86868b;}
.nav__dropdown-item{display:block;padding:10px 15px;font-size:13px;color:#1d1d1f;text-decoration:none;transition:background .12s;}
.nav__dropdown-item:hover{background:rgba(255,255,255,0.65);text-decoration:none;}
.nav__dropdown-item--danger{color:#ff3b30;}
.nav__dropdown-item--danger:hover{background:rgba(255,59,48,0.07);}
.nav__dropdown-divider{border:none;border-top:1px solid rgba(255,255,255,0.60);margin:3px 0;}
@media(max-width:768px){.nav__search{display:none;}.nav__inner{padding:0 12px;gap:4px;}}
@media(max-width:640px){.nav__links{display:none!important;}.nav__brand span{display:none;}}

/* ── BANNERS ─────────────────────────────────────────────────────── */
.urgent-banner {
  background: var(--gold-bg);
  border-bottom: 2px solid var(--gold);
  padding: 12px var(--sp-6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-base);
  font-weight: 500;
  color: #7a5a00;
}
.urgent-banner__icon { font-size: 18px; }
.urgent-banner__msg  { flex: 1; }
.urgent-banner__dismiss {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: opacity var(--t-fast);
}
.urgent-banner__dismiss:hover { opacity: 0.88; }

.broadcast-banner {
  background: var(--brand);
  color: #fff;
  padding: 10px var(--sp-6);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-base);
}
.broadcast-banner__icon { font-size: 16px; }
.broadcast-banner button { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; font-size: 16px; line-height: 1; margin-left: auto; }

/* ── LAYOUT SCAFFOLDS ────────────────────────────────────────────── */
.page-3col {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
  display: grid;
  grid-template-columns: 230px minmax(0, var(--max-feed)) 260px;
  gap: var(--sp-5);
  align-items: start;
}
.page-1col {
  max-width: var(--max-feed);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
}
.page-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
}
@media (max-width: 960px) {
  .page-3col { grid-template-columns: 1fr; }
  .page-3col .sidebar-left,
  .page-3col .sidebar-right { display: none; }
}

/* ── CARD ────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--sp-3); }
.card__body { padding: var(--sp-4) var(--sp-5); }
.card__head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card__foot { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--border); background: var(--surface); }

/* ── FEED COMPOSER ───────────────────────────────────────────────── */
.composer { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.composer__row { display: flex; align-items: center; gap: var(--sp-3); }
.composer__input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--r-full);
  padding: 9px 16px;
  font-size: var(--text-base);
  color: var(--ink);
  transition: border-color var(--t-base), background var(--t-base);
  cursor: pointer;
}
.composer__input:focus { background: var(--white); border-color: var(--brand); cursor: text; outline: none; }
.composer__actions { display: flex; gap: 2px; padding-top: var(--sp-3); border-top: 1px solid var(--border); margin-top: var(--sp-3); }
.composer__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mid);
  background: none;
  border: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.composer__btn:hover { background: var(--surface-2); color: var(--ink); }

/* ── POST CARD ───────────────────────────────────────────────────── */
.post { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--sp-3); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow var(--t-base); }
.post:hover { box-shadow: var(--shadow-md); }
.post__head { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
.post__meta .post__name { font-size: var(--text-base); font-weight: 600; color: var(--ink); }
.post__meta .post__relation { font-size: var(--text-sm); color: var(--subtle); }
.post__meta .post__time { font-size: var(--text-xs); color: var(--ghost); margin-top: 1px; }
.post__body { padding: 0 var(--sp-5) var(--sp-4); font-size: var(--text-md); line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.post__media { width: 100%; max-height: 480px; object-fit: cover; }
.post__video { width: 100%; max-height: 360px; background: #000; display: block; }
.post__reactions-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px var(--sp-5); border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--subtle); }
.post__actions { display: flex; border-top: 1px solid var(--border); }
.post__action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mid);
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  transition: background var(--t-fast), color var(--t-fast);
}
.post__action-btn:last-child { border-right: none; }
.post__action-btn:hover { background: var(--surface); color: var(--ink); }
.post__action-btn--active { color: var(--brand); }

/* ── BADGES ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}
.badge--administrator { background: #fef3e2; color: #92650a; }
.badge--editor        { background: var(--brand-light); color: var(--brand-text); }
.badge--member        { background: var(--surface-2); color: var(--mid); }
.badge--active        { background: var(--success-bg); color: var(--success); }
.badge--pending       { background: var(--warn-bg); color: #7a5a00; }
.badge--deactivated   { background: var(--danger-bg); color: var(--danger); }

/* ── AVATAR ──────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar--sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar--md  { width: 38px; height: 38px; font-size: 14px; }
.avatar--lg  { width: 52px; height: 52px; font-size: 18px; }
.avatar--xl  { width: 80px; height: 80px; font-size: 26px; }
.avatar img  { width: 100%; height: 100%; object-fit: cover; }

/* ── BUTTONS ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); text-decoration: none; }
.btn--primary   { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn--danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover  { opacity: 0.88; }
.btn--ghost     { background: none; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--ink); }
.btn--sm        { padding: 6px 14px; font-size: var(--text-sm); }
.btn--full      { width: 100%; }
.btn--icon      { padding: 8px; border-radius: 50%; width: 36px; height: 36px; }
.btn:disabled   { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--t-base), background var(--t-base);
  font-family: var(--font-body);
}
.btn-google:hover { border-color: var(--brand); background: var(--brand-light); text-decoration: none; }

/* ── FORM CONTROLS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--text-md);
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,107,74,0.12);
  outline: none;
}
.form-control::placeholder { color: var(--ghost); }
.form-control--error { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0a6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: var(--text-xs); color: var(--subtle); margin-top: 4px; }
.form-error { font-size: var(--text-xs); color: var(--danger); margin-top: 4px; }

.input-reveal-wrap { position: relative; }
.input-reveal-wrap .form-control { padding-right: 40px; }
.input-reveal-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--subtle); padding: 4px; }
.input-reveal-btn:hover { color: var(--brand); }

/* ── ALERTS ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: var(--text-base);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.alert--info    { background: var(--info-bg);    border: 1px solid #a9cfe0; color: #1a5276; }
.alert--warn    { background: var(--warn-bg);    border: 1px solid #f5d79e; color: #7a5a00; }
.alert--success { background: var(--success-bg); border: 1px solid #a9dfbf; color: #1e8449; }
.alert--error   { background: var(--danger-bg);  border: 1px solid #f1a9a0; color: #a93226; }

/* ── TOAST NOTIFICATIONS ─────────────────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 20px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-base);
  font-weight: 500;
  max-width: 380px;
  animation: slideInRight 0.2s ease;
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast--success { background: var(--success); color: #fff; }
.toast--error   { background: var(--danger);  color: #fff; }
.toast__icon { font-size: 16px; flex-shrink: 0; }
.toast__close { background: rgba(255,255,255,0.25); border: none; color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1; margin-left: auto; flex-shrink: 0; }
.toast__close:hover { background: rgba(255,255,255,0.4); }

/* ── DIVIDER ─────────────────────────────────────────────────────── */
.divider-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: var(--text-sm);
  color: var(--subtle);
}
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── AUTH PAGES ──────────────────────────────────────────────────── */
.auth-body { background: var(--surface); min-height: 100vh; display: flex; align-items: stretch; }
.auth-wrap { display: flex; min-height: 100vh; width: 100%; }

.auth-hero {
  flex: 1;
  background: linear-gradient(160deg, var(--brand) 0%, #0e4530 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10);
  min-height: 100vh;
}
.auth-hero__inner { max-width: 360px; color: #fff; }
.auth-hero__logo  { margin-bottom: var(--sp-6); }
.auth-hero__title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: var(--sp-4);
}
.auth-hero__title em { font-style: italic; color: rgba(255,255,255,0.75); }
.auth-hero__tagline { font-size: var(--text-lg); color: rgba(255,255,255,0.65); line-height: 1.55; margin-bottom: var(--sp-8); }
.auth-hero__stats { display: flex; gap: var(--sp-6); }
.auth-hero__stat strong { display: block; font-size: var(--text-2xl); font-weight: 700; color: #fff; font-family: var(--font-display); }
.auth-hero__stat span   { font-size: var(--text-sm); color: rgba(255,255,255,0.55); }

.auth-form-panel { flex: 0 0 480px; display: flex; align-items: center; justify-content: center; padding: var(--sp-8); background: var(--white); }
.auth-form-wrap  { width: 100%; max-width: 360px; }
.auth-form-header { margin-bottom: var(--sp-6); }
.auth-form-title { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.auth-form-sub   { font-size: var(--text-base); color: var(--mid); }
.auth-form-footer { font-size: var(--text-sm); color: var(--mid); margin-top: var(--sp-4); text-align: center; }
.auth-form-footer--muted { color: var(--ghost); font-size: var(--text-xs); margin-top: var(--sp-2); }

@media (max-width: 768px) {
  .auth-hero  { display: none; }
  .auth-form-panel { flex: 1; }
}

/* ── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm); }
.sidebar-card__head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.sidebar-card__title { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); }
.sidebar-card__body { padding: var(--sp-3) var(--sp-4); }

/* ── FAMILY TREE PAGE ────────────────────────────────────────────── */
.tree-wrap { height: calc(100vh - var(--nav-h) - 44px); display: flex; flex-direction: column; overflow: hidden; }
.tree-toolbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 10px var(--sp-4); min-height: 52px; display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.tree-canvas { flex: 1; overflow: hidden; position: relative; cursor: grab; min-height: 0; background: var(--surface); background-image: radial-gradient(circle, rgba(180,190,200,0.25) 1px, transparent 1px); background-size: 24px 24px; }
.tree-canvas.dragging { cursor: grabbing; }

.tree-panel {
  position: absolute;
  top: 0; right: 0;
  width: 320px;
  height: 100%;
  background: var(--white);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--t-slow) cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: var(--shadow-lg);
}
.tree-panel--open { transform: translateX(0); }

/* Mobile: panel slides up from bottom */
@media (max-width: 600px) {
  .tree-panel {
    width: 100%;
    height: 75vh;
    top: auto;
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .tree-panel--open { transform: translateY(0); }
}

/* ── ADMIN TABLE ─────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table th { text-align: left; padding: 10px 14px; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--subtle); border-bottom: 2px solid var(--border); background: var(--surface); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface); }
.data-table tr:last-child td { border-bottom: none; }

/* ── PAGINATION ──────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: var(--sp-4) 0; }
.pagination__btn {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-base);
  color: var(--ink);
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
}
.pagination__btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination__btn--active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination__btn--disabled { opacity: 0.4; pointer-events: none; }

/* ── SPINNER ─────────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PROFILE HERO ────────────────────────────────────────────────── */
.profile-hero { height: 120px; background: linear-gradient(135deg, var(--brand) 0%, #0e4530 100%); position: relative; }
.profile-hero__avatar { position: absolute; bottom: -28px; left: var(--sp-5); border: 3px solid var(--white); border-radius: 50%; }

/* ── FOOTER ──────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); padding: 12px var(--sp-6); margin-top: auto; }
.site-footer__inner { max-width: var(--max-wide); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }

/* ── UTILITY ─────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.text-muted  { color: var(--subtle); }
.text-danger { color: var(--danger); }
.text-brand  { color: var(--brand); }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.fw-600      { font-weight: 600; }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ── MOBILE RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .page-3col { grid-template-columns: 1fr !important; }
  .sidebar-left, .sidebar-right { display: none !important; }
}
@media (max-width: 768px) {
  .nav__search { display: none; }
  .nav__inner { padding: 0 12px; gap: 6px; }
  .nav__link { padding: 6px 8px; font-size: 10px; }
}
@media (max-width: 640px) {
  .nav__links { display: none !important; }
  .nav__mobile-links { display: flex !important; }
  .site-footer { display: none; }
  .nav__brand span { display: none; }
  body { padding-bottom: 68px; }
  .page-3col, .page-1col, .page-wide { padding: 8px; }
}
.nav__mobile-links {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 9999;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
@media (min-width: 641px) {
  .nav__mobile-links { display: none !important; }
}
.nav__mobile-links a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 7.5px;
  color: var(--mid);
  text-decoration: none;
  padding: 6px 1px;
  font-weight: 500;
  min-width: 0;
}
.nav__mobile-links svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav__mobile-links a.on { color: var(--brand); }

/* Share dropdown items */
.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  border: none;
  background: #fff;
  width: 100%;
  text-align: left;
}
.share-item:hover { background: var(--surface); }

@media (max-width: 900px) {
  .auth-wrap {
    flex-direction: column !important;
  }
  .auth-hero {
    display: none !important;
  }
  .auth-form-panel {
    width: 100% !important;
    flex: 1 !important;
  }
  .mobile-hero {
    display: block !important;
  }
}


/* ── AUTH MOBILE FIX ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-body { display: block !important; }
  .auth-wrap { display: flex !important; flex-direction: column !important; min-height: unset !important; width: 100% !important; }
  .auth-hero { display: none !important; min-height: unset !important; }
  .auth-form-panel { flex: 1 !important; width: 100% !important; min-height: unset !important; }
  .mobile-hero { display: block !important; }
}