@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* =====================================================================
   Design tokens — copied directly from the mdvmiami.org design system
   so mymdv.org reads as the same brand, not a reinterpretation.
   ===================================================================== */
:root {
  --bg-default: #FFFFFF;
  --bg-paper: #F5F5F5;
  --bg-paper-2: #ECECEC;
  --text-primary: rgba(0,0,0,.87);
  --text-secondary: rgba(0,0,0,.6);
  --divider: rgba(0,0,0,.12);
  --action-bg: #000000;
  --action-text: #FFFFFF;
  --action-bg-hover: #242424;
  --outline-hover-bg: rgba(0,0,0,.05);
  --nav-scrolled-bg: rgba(255,255,255,.85);
  --shadow-nav: 0 1px 2px rgba(0,0,0,.06);
  --shadow-card: 0 1px 3px rgba(0,0,0,.08);

  /* Additions needed for a functional auth UI, kept in the same
     monochrome-first spirit — used sparingly, never decoratively. */
  --danger: #B3261E;
  --danger-bg: #FBEAE9;
  --focus-ring: #000000;
  --radius: 4px;
  --child-badge-bg: #e6f4ea;
  --child-badge-text: #1e7e34;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-default: #0A0A0A;
    --bg-paper: #1A1A1A;
    --bg-paper-2: #222222;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255,255,255,.7);
    --divider: rgba(255,255,255,.12);
    --action-bg: #FFFFFF;
    --action-text: #212121;
    --action-bg-hover: #E4E4E4;
    --outline-hover-bg: rgba(255,255,255,.08);
    --nav-scrolled-bg: rgba(10,10,10,.82);
    --shadow-nav: 0 1px 2px rgba(0,0,0,.5);
    --shadow-card: 0 1px 3px rgba(0,0,0,.5);

    --danger: #FF6B61;
    --danger-bg: #2A1613;
    --focus-ring: #FFFFFF;
    --child-badge-bg: rgba(46,160,67,.18);
    --child-badge-text: #4fd671;
  }
}

/* ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-default);
}

body.sidebar-open-lock {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 .5rem;
}

p { margin: 0 0 1rem; color: var(--text-secondary); }

a { color: inherit; }

img, svg { max-width: 100%; display: block; }

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}
.icon-lg {
  width: 40px;
  height: 40px;
  margin: 0 auto;
}

/* Visible keyboard focus everywhere — never suppressed */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* =====================================================================
   Layout
   ===================================================================== */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-default);
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.brand-mark {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 900px) {
  .container { padding: 0 48px; }
}

/* =====================================================================
   Card
   ===================================================================== */
.card {
  background: var(--bg-paper);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 28px;
}
@media (max-width: 420px) {
  .card { padding: 28px 20px; }
}

/* =====================================================================
   Buttons — primary / outline / ghost, exactly per the design system
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 44px;
  padding: .9rem 1.9rem;
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--action-bg);
  color: var(--action-text);
}
.btn-primary:hover:not(:disabled) { background: var(--action-bg-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--divider);
}
.btn-outline:hover:not(:disabled) { background: var(--outline-hover-bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  width: auto;
  min-height: 44px;
  padding: .5rem .25rem;
  font-weight: 500;
}
.btn-ghost .icon { transition: transform .15s ease; width: 16px; height: 16px; }
.btn-ghost:hover .icon { transform: translateX(3px); }

/* Icon-only buttons (e.g. show/hide password) still meet the 44x44 target */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover { background: var(--outline-hover-bg); }

/* =====================================================================
   Form fields
   ===================================================================== */
.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: .375rem;
}

.field-input {
  display: flex;
  align-items: center;
  gap: .625rem;
  background: var(--bg-default);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 0 .875rem;
}
.field-input:focus-within {
  border-color: var(--text-primary);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
.field-input .icon { color: var(--text-secondary); }

.field-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  padding: .8rem 0;
  min-height: 44px;
}
.field-input input:focus { outline: none; }
.field-input input::placeholder { color: var(--text-secondary); opacity: .6; }

.field-hint {
  font-size: .8125rem;
  color: var(--text-secondary);
  margin-top: .375rem;
}

/* =====================================================================
   Alerts
   ===================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  margin-bottom: 1.25rem;
}
.alert .icon { margin-top: 2px; }
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}
.alert-success {
  background: var(--bg-paper-2);
  color: var(--text-primary);
}

/* =====================================================================
   Avatar — a deliberate exception to the 4px image rule; an account
   avatar is conventionally circular (Apple ID, Google, Slack) and the
   brief specifically asked for "their picture in a circle."
   ===================================================================== */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--action-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1.25rem;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   Water divider — the site's signature motif, echoed here rather than
   inventing a competing one. Draws itself in once on load (these pages
   are short enough that a scroll trigger rarely fires).
   ===================================================================== */
.water-divider {
  height: 1px;
  background: var(--divider);
  transform: scaleX(0);
  transform-origin: left;
  animation: draw-divider .9s ease .3s forwards;
}

/* =====================================================================
   Reveal-in — same easing/duration as the main site's reveal-on-scroll,
   just triggered on load instead of scroll for these single-view pages.
   ===================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-in .7s ease forwards;
}
.reveal-delay-1 { animation-delay: .08s; }
.reveal-delay-2 { animation-delay: .16s; }
.reveal-delay-3 { animation-delay: .24s; }

@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes draw-divider {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; }
  .water-divider { transform: scaleX(1); animation: none; }
  .btn:active { transform: none; }
}

/* =====================================================================
   Dashboard
   ===================================================================== */
/* =====================================================================
   App shell — sidebar (desktop) / hamburger drawer (mobile)
   ===================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.brand-lockup { display: inline-flex; align-items: center; gap: .12em; color: inherit; font-size: 1.25rem; font-weight: 800; }
.brand-logo { width: 1.2em; height: 1.2em; color: currentColor; flex-shrink: 0; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-paper);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  margin-bottom: 24px;
}
.sidebar-close-btn { display: none; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .8rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
  min-height: 44px;
  transition: background-color .12s ease, color .12s ease;
}
.sidebar-nav-item .icon { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-nav-item:hover { background: var(--outline-hover-bg); color: var(--text-primary); }
.sidebar-nav-item.is-active { background: var(--action-bg); color: var(--action-text); }

.sidebar-footer { border-top: 1px solid var(--divider); padding-top: 12px; margin-top: 12px; }

.locale-toggle-sidebar { display: flex; gap: 2px; padding: 0 .8rem .75rem; }
.locale-toggle-sidebar a {
  font-size: .75rem; font-weight: 600; padding: .3rem .6rem; border-radius: var(--radius);
  text-decoration: none; color: var(--text-secondary); border: 1px solid var(--divider);
}
.locale-toggle-sidebar a.is-active { background: var(--action-bg); color: var(--action-text); border-color: var(--action-bg); }

.sidebar-user { display: flex; align-items: center; gap: .625rem; padding: .5rem .8rem .75rem; }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--action-bg); color: var(--action-text);
  display: flex; align-items: center; justify-content: center;
  font-size: .8125rem; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-name { font-size: .875rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-overlay { display: none; }

.mobile-topbar { display: none; }

.main-content { flex: 1; min-width: 0; }

.dashboard-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 56px 24px 0;
  max-width: 640px;
  margin: 0 auto;
}
.dashboard-hero h1 { font-size: 1.75rem; margin: 0 0 .25rem; }
.dashboard-hero .field-hint { font-size: .9375rem; }

.role-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 500;
  padding: .25rem .7rem;
  border-radius: var(--radius);
  background: var(--bg-paper-2);
  color: var(--text-secondary);
  margin: 0 3px;
}
.role-badge-muted { opacity: .55; }
.role-badge-child { background: var(--child-badge-bg); color: var(--child-badge-text); }

.report-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.report-summary-card { background: var(--bg-paper); border: 1px solid var(--divider); border-radius: var(--radius); padding: 18px; text-align: center; }
.report-summary-number { font-size: 1.875rem; font-weight: 700; line-height: 1.1; }
.report-summary-label { font-size: .8125rem; color: var(--text-secondary); margin-top: 6px; }

.report-section { margin-bottom: 2rem; }
.report-section h2 { font-size: 1.0625rem; margin-bottom: 1rem; }
.report-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.report-bar-label { width: 90px; flex-shrink: 0; font-size: .8125rem; color: var(--text-secondary); }
.report-bar-track { flex: 1; background: var(--bg-paper-2); border-radius: 4px; height: 22px; overflow: hidden; }
.report-bar-fill { height: 100%; background: var(--action-bg); border-radius: 4px; min-width: 2px; }
.report-bar-count { width: 36px; text-align: right; flex-shrink: 0; font-size: .8125rem; font-weight: 600; }

.notes-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.report-donuts-row { display: flex; gap: 32px; flex-wrap: wrap; }
.donut-wrapper { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-chart {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.donut-chart::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68%; height: 68%;
  border-radius: 50%;
  background: var(--bg-default);
}
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
}
.donut-center-number { font-size: 1.375rem; font-weight: 700; line-height: 1.1; }
.donut-center-label { font-size: .6875rem; color: var(--text-secondary); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.donut-legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-count { color: var(--text-secondary); margin-left: 2px; }

/* =====================================================================
   People module
   ===================================================================== */
.page-wrap { max-width: 960px; margin: 0 auto; padding: 40px 24px 64px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header .btn { display: inline-flex; align-items: center; gap: .5rem; }
.page-header .btn .icon { width: 18px; height: 18px; }

.section-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--divider); }
.section-tabs a {
  padding: .6rem 1rem; font-size: .875rem; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.section-tabs a.is-active { color: var(--text-primary); border-bottom-color: var(--action-bg); }
.section-tabs a:hover { color: var(--text-primary); }

.person-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.person-header-photo-wrap { position: relative; flex-shrink: 0; }
.person-header-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--action-bg); color: var(--action-text);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; overflow: hidden;
}
.person-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-photo-edit-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--action-bg); color: var(--action-text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid var(--bg-default);
}
.person-photo-edit-btn .icon { width: 15px; height: 15px; }
.person-header-info { flex: 1; min-width: 220px; padding-top: 4px; }
.person-header-info h1 { font-size: 1.75rem; margin: 0 0 4px; }
.person-header-contact { color: var(--text-secondary); font-size: .9375rem; }
.person-header-badges { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }

.person-layout { display: grid; grid-template-columns: 190px 1fr 300px; gap: 24px; align-items: start; }
.person-sidebar { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 1.5rem; }

.person-tabs { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.person-tab-item {
  display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem;
  border-radius: var(--radius); color: var(--text-secondary); text-decoration: none;
  font-size: .875rem; font-weight: 500; border: none; background: none; cursor: pointer;
  font-family: inherit; text-align: left; width: 100%;
}
.person-tab-item .icon { width: 17px; height: 17px; flex-shrink: 0; }
.person-tab-item:hover { background: var(--outline-hover-bg); color: var(--text-primary); }
.person-tab-item.is-active { background: var(--action-bg); color: var(--action-text); }
.person-tab-item.is-danger { color: #d9534f; }
.person-tab-item.is-danger:hover { background: rgba(217,83,79,.1); }

.person-tab-select {
  display: none;
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--bg-default);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 600;
  grid-column: 1 / -1;
}

.person-tab-panel { display: none; }
.person-tab-panel.is-active { display: block; }

.family-list { display: flex; flex-direction: column; gap: 4px; }
.family-member-link {
  display: flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none;
  font-size: .9375rem; padding: .4rem 0;
}
.family-member-link:hover { text-decoration: underline; }
.family-member-avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--action-bg); color: var(--action-text);
  display: flex; align-items: center; justify-content: center; font-size: .6875rem; font-weight: 700;
}
.family-member-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) {
  .person-layout { grid-template-columns: 1fr; }
  .person-sidebar { position: static; }
  .person-tabs { display: none; }
  .person-tab-select { display: block; margin-bottom: 1.5rem; }

  .section-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .section-tabs a { white-space: nowrap; flex-shrink: 0; }
}

.people-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 24px; }
.people-select {
  padding: .65rem .8rem; border: 1px solid var(--divider); border-radius: var(--radius);
  background: var(--bg-default); color: var(--text-primary); font-family: inherit; font-size: .875rem;
  min-height: 44px;
}

.people-list { display: flex; flex-direction: column; gap: 2px; }
.people-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: var(--radius); text-decoration: none; color: var(--text-primary);
  transition: background-color .12s ease;
}
.people-row:hover { background: var(--bg-paper); }
.people-row-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.people-row-name { font-weight: 600; font-size: .9375rem; }

.people-table-wrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--divider); border-radius: var(--radius); }
.people-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.people-table thead th {
  text-align: left; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--divider); white-space: nowrap;
  background: var(--bg-paper);
}
.people-table tbody tr {
  border-bottom: 1px solid var(--divider); cursor: pointer; transition: background-color .12s ease;
}
.people-table tbody tr:last-child { border-bottom: none; }
.people-table tbody tr:hover { background: var(--bg-paper); }
.people-table td { padding: 10px 16px; vertical-align: middle; font-size: .875rem; white-space: nowrap; }
.people-table .col-name { font-weight: 600; white-space: normal; }
.people-table .col-photo { width: 44px; padding-right: 0; }
.people-table-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--action-bg); color: var(--action-text);
  display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.people-table-avatar img { width: 100%; height: 100%; object-fit: cover; }
.people-table-count { font-size: .9375rem; font-weight: 600; margin-bottom: 12px; }

.detail-section { margin-bottom: 2rem; }
.detail-section h2 { font-size: 1.0625rem; margin-bottom: .75rem; }
.milestone-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: .75rem 0; border-bottom: 1px solid var(--divider);
}
.milestone-row:last-child { border-bottom: none; }
.milestone-row label { display: flex; align-items: center; gap: .625rem; font-size: .9375rem; cursor: pointer; }
.milestone-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--action-bg); }
.milestone-date { font-size: .8125rem; color: var(--text-secondary); }

.note-item { padding: .875rem 0; border-bottom: 1px solid var(--divider); }
.note-item:last-child { border-bottom: none; }
.note-item p { color: var(--text-primary); margin-bottom: .25rem; white-space: pre-wrap; }

.activity-timeline { position: relative; padding-left: 40px; }
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--divider);
}
.activity-item { position: relative; margin-bottom: 1.5rem; }
.activity-item:last-child { margin-bottom: 0; }
.activity-marker {
  position: absolute;
  left: -40px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--action-text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  flex-shrink: 0;
}
.activity-marker .icon { width: 16px; height: 16px; }
.activity-card { background: var(--bg-paper); border: 1px solid var(--divider); border-radius: var(--radius); padding: 16px 18px; }
.activity-title { font-weight: 600; font-size: .9375rem; margin-bottom: 2px; }
.activity-time { font-size: .8125rem; color: var(--text-secondary); }
.activity-diff-table { width: 100%; border-collapse: collapse; margin-top: .875rem; }
.activity-diff-table th {
  text-align: left; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-secondary); padding: 4px 10px 6px 0; border-bottom: 1px solid var(--divider);
}
.activity-diff-table td { padding: 8px 10px 8px 0; font-size: .875rem; border-bottom: 1px solid var(--divider); vertical-align: top; }
.activity-diff-table tr:last-child td { border-bottom: none; }
.activity-diff-field { color: var(--text-secondary); white-space: nowrap; }
.activity-diff-before { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--divider); }
.activity-diff-after { color: var(--text-primary); font-weight: 500; }
.activity-empty { color: var(--text-secondary); font-size: .9375rem; padding: 8px 0; }
.note-meta { font-size: .75rem; color: var(--text-secondary); }

.family-list { display: flex; flex-direction: column; gap: 4px; }
.family-row {
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.is-open { display: flex; }

.modal-box {
  background: var(--bg-default);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 12px; }
.modal-header h2 { font-size: 1.125rem; margin: 0; }

.family-modal-member {
  display: block;
  padding: .75rem .5rem;
  border-bottom: 1px solid var(--divider);
  color: var(--text-primary);
  text-decoration: none;
  font-size: .9375rem;
}
.family-modal-member:last-child { border-bottom: none; }
.family-modal-member:hover { background: var(--bg-paper); border-radius: var(--radius); }

@media (max-width: 480px) {
  .page-wrap { padding: 24px 16px 48px; }
  .people-row { flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 101;
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close-btn { display: inline-flex; }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 100;
  }
  .sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--divider);
  }
  .mobile-topbar-spacer { width: 44px; }

  .dashboard-hero { padding: 40px 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar-overlay { transition: none; }
}

/* =====================================================================
   Print — People list. Only takes effect during an actual print/preview;
   .print-only content is hidden the rest of the time.
   ===================================================================== */
.print-only { display: none; }

@media print {
  .sidebar, .sidebar-overlay, .mobile-topbar, .no-print { display: none !important; }
  .app-shell { display: block; }
  .page-wrap { max-width: 100%; padding: 0; margin: 0; }

  body { background: #fff; color: #000; }

  .print-only { display: block; }
  .print-header { margin-bottom: 16px; }
  .print-header h1 { font-size: 1.25rem; margin: 0 0 4px; color: #000; }
  .print-header p { font-size: .8125rem; color: #444; margin: 0; }

  .people-table-wrap { overflow: visible; border: none; }
  .people-table { min-width: 0; width: 100%; }
  .people-table thead th {
    background: #fff !important; color: #000 !important; border-bottom: 1px solid #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .people-table td { color: #000; border-bottom: 1px solid #ccc; }
  .people-table tbody tr { cursor: default; }
  .people-table .col-photo { display: none; }
  .role-badge { background: none !important; color: #000 !important; padding: 0; border: 1px solid #999; }
  .people-table a { color: #000; text-decoration: none; }
}
