/* theme.css — the POA NexGen skin, loaded after app.css so it wins.
   ---------------------------------------------------------------------------
   app.css is left untouched on purpose. It is written entirely against design
   tokens, so re-declaring those tokens re-skins every page at once without a
   single change to any markup. Delete this file's <link> and the Apple look
   comes straight back.

   Copper accent, ink greys, Plus Jakarta Sans, softer corners and a dark
   charcoal menu — the same language as POA NexGen CRM. */

:root {
  /* --- copper: the brand, and the only colour that acts --- */
  --copper-50:  #FBF3EE;
  --copper-100: #F5E1D2;
  --copper-200: #EBC1A6;
  --copper-300: #DDA079;
  --copper-400: #CC7E54;
  --copper-500: #B5552B;
  --copper-600: #9A4523;
  --copper-700: #7B371D;

  /* --- ink: everything that does not act --- */
  --ink-50:  #F7F7F8;
  --ink-100: #EEEEF1;
  --ink-200: #D7D8DC;
  --ink-300: #B0B2BA;
  --ink-400: #7E818D;
  --ink-500: #52555F;
  --ink-600: #363842;
  --ink-700: #22242B;
  --ink-800: #15171C;
  --ink-900: #0A0B0E;

  /* app.css derives --accent from --tint, so this one line moves the whole app */
  --tint: var(--copper-500);
  --tint-press: var(--copper-600);

  --bg: var(--ink-50);
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;

  --fill: rgba(84, 82, 95, .07);
  --fill-2: rgba(84, 82, 95, .04);
  --fill-press: rgba(84, 82, 95, .13);

  --border: var(--ink-100);
  --border-strong: var(--ink-200);

  --text: #1A1C22;
  --muted: var(--ink-500);
  --faint: var(--ink-400);

  --accent: var(--copper-500);
  --accent-soft: var(--copper-50);
  --accent-text: #FFFFFF;

  --ok: #147A45;     --ok-soft: #E4F3EA;
  --warn: #9A5B12;   --warn-soft: #FBEFD9;
  --danger: #B4322A; --danger-soft: #FCEBE9;
  --info: #1D4ED8;   --info-soft: #E6ECFB;

  /* corners: inputs 10, buttons 12, cards 16, sheets 20 */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 24px;

  /* elevation: three layers, wide and soft rather than a single dark drop */
  --shadow-1: 0 1px 2px -1px rgba(16,17,28,.05), 0 2px 6px -2px rgba(16,17,28,.05);
  --shadow-2: 0 1px 2px -1px rgba(16,17,28,.05), 0 2px 6px -2px rgba(16,17,28,.05),
              0 24px 48px -28px rgba(16,17,28,.18);
  --shadow-3: 0 20px 60px rgba(16,17,28,.22);
  --shadow: var(--shadow-1);

  --material-thin:  rgba(255,255,255,.78);
  --material-thick: rgba(250,250,251,.88);
  --scrim: rgba(10,11,14,.45);

  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

/* Dark mode keeps the copper but lifts it, so it still reads on a dark ground. */
@media (prefers-color-scheme: dark) {
  :root {
    --tint: var(--copper-400);
    --tint-press: var(--copper-300);
    --accent: var(--copper-400);
    --accent-soft: rgba(181, 85, 43, .20);
    --bg: #0E0F12;
    --surface: #17181D;
    --surface-2: #1D1F25;
    --border: rgba(255,255,255,.10);
    --border-strong: rgba(255,255,255,.18);
    --text: #ECECEE;
    --muted: #A0A2AB;
    --faint: #7E818D;
  }
}

body { letter-spacing: -0.011em; }

/* ---------------------------------------------------------------- the menu */
/* A dark rail. It anchors the page and stops the sidebar competing with the
   content for attention, which a light-on-light panel always does. */
#sidebar {
  background: var(--ink-800);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-right: none;
  color: rgba(255,255,255,.74);
}
#sidebar .brand { border-bottom: 1px solid rgba(255,255,255,.07); }
#sidebar .brand-name { color: #fff; font-weight: 800; letter-spacing: -.02em; }
#sidebar .brand-sub {
  color: var(--copper-300);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 10px;
}

#nav a {
  color: rgba(255,255,255,.74);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
#nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
#nav a.active {
  background: rgba(181,85,43,.22);
  color: var(--copper-300);
  font-weight: 600;
}
#nav a .count {
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.08);
  border-radius: 999px; padding: 1px 7px; font-weight: 700;
}
#nav a.active .count { color: var(--copper-200); background: rgba(181,85,43,.30); }
#nav .nav-group {
  color: rgba(255,255,255,.34);
  text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: 9px;
}
/* The account block at the foot of the menu sits on the dark ground too. */
#nav > div:last-child { border-top: 1px solid rgba(255,255,255,.08) !important; }
#nav > div:last-child .small { color: rgba(255,255,255,.88); }
#nav > div:last-child .muted { color: rgba(255,255,255,.50); }
#sidebar .sm.ghost {
  color: rgba(255,255,255,.70);
  border: 1px solid rgba(255,255,255,.14);
  background: transparent;
}
#sidebar .sm.ghost:hover { color: #fff; background: rgba(255,255,255,.10); }

/* the phone bar matches the rail */
#mobile-bar { background: var(--ink-800); color: #fff; border-bottom: none; }
#mobile-bar .mobile-menu, #mobile-bar .mobile-title { color: #fff; }

/* ---------------------------------------------------------------- surfaces */
.card, .erp-card { box-shadow: var(--shadow-2); border-color: var(--border); }

/* The action colour earns a little weight — it is the one thing people press. */
button.primary, .btn.primary, .primary {
  background: var(--copper-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16,17,28,.20),
              0 10px 24px -10px rgba(181,85,43,.50),
              inset 0 1px 0 rgba(255,255,255,.16);
}
button.primary:hover, .btn.primary:hover, .primary:hover {
  background: var(--copper-500);
  box-shadow: 0 1px 2px rgba(16,17,28,.20),
              0 14px 30px -10px rgba(181,85,43,.60),
              inset 0 1px 0 rgba(255,255,255,.18);
}

/* ---------------------------------------------------------- the sign-in page */
/* The picture is painted here rather than added to the markup, so the two-step
   verification and password screens keep working untouched. */
#auth-screen {
  background: var(--ink-800);
  background-image:
    radial-gradient(120% 90% at 50% -10%, rgba(255,255,255,.10), transparent 60%);
}

/* A true two-panel sign-in: picture on the left, form on the right.
   #auth-screen holds exactly one child (.auth-card), so the card itself becomes
   the shell. The left half is reserved with padding and the picture is painted
   into it by an absolutely positioned ::before, so however many things the app
   renders on the right — an error banner, the demo-role list, the two-step
   verification boxes — the picture still fills its half from top to bottom.
   No markup changes at all, which is what keeps the two-step verification and
   password screens working untouched.

   (A CSS grid was tried first and cannot do this: with no grid-template-rows
   declared the explicit grid has no rows, so `grid-row: 1 / -1` collapses onto
   row one and the picture's height stretched the church logo instead.) */
/* Only when the church has NOT uploaded its own sign-in photo. An administrator
   who sets one in Settings gets the app's original full-bleed backdrop instead,
   and this whole split layout stands aside. The selector carries an id so it
   outranks app.css's `.auth-card.has-demo { max-width: 470px }`. */
#auth-screen:not(.has-backdrop) > .auth-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 960px;
  min-height: 540px;
  padding: 0 0 0 530px;
  overflow: hidden;
  text-align: left;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
}

/* The picture. A drawn stained-glass window rather than a photograph: nothing
   to license, no file to load, and it works with no internet. Sized by height
   so it stays whole however tall the form beside it grows — the earlier version
   used `cover` and cropped the window to a letterbox. */
#auth-screen:not(.has-backdrop) > .auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 530px;
  background-color: var(--ink-800);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(0,0,0,.10) 45%, rgba(0,0,0,.55) 100%),
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 330'%3E%3Cg stroke='%23fff' stroke-width='2' opacity='.16'%3E%3Cline x1='120' y1='95' x2='20' y2='10'/%3E%3Cline x1='120' y1='95' x2='70' y2='0'/%3E%3Cline x1='120' y1='95' x2='170' y2='0'/%3E%3Cline x1='120' y1='95' x2='220' y2='10'/%3E%3Cline x1='120' y1='95' x2='8' y2='120'/%3E%3Cline x1='120' y1='95' x2='232' y2='120'/%3E%3C/g%3E%3Cg fill='%23fff' opacity='.85'%3E%3Crect x='117' y='14' width='6' height='46' rx='2'/%3E%3Crect x='103' y='28' width='34' height='6' rx='2'/%3E%3C/g%3E%3Cpath d='M70 300 L70 122 A50 50 0 0 1 170 122 L170 300 Z' fill='%23fff' opacity='.10'/%3E%3Cg fill='%23fff'%3E%3Crect x='78' y='130' width='36' height='48' opacity='.22'/%3E%3Crect x='126' y='130' width='36' height='48' opacity='.14'/%3E%3Crect x='78' y='186' width='36' height='48' opacity='.13'/%3E%3Crect x='126' y='186' width='36' height='48' opacity='.24'/%3E%3Crect x='78' y='242' width='36' height='50' opacity='.20'/%3E%3Crect x='126' y='242' width='36' height='50' opacity='.12'/%3E%3C/g%3E%3Cg stroke='%23fff' stroke-width='3' opacity='.55' fill='none'%3E%3Cpath d='M70 300 L70 122 A50 50 0 0 1 170 122 L170 300'/%3E%3Cline x1='120' y1='76' x2='120' y2='300'/%3E%3Cline x1='70' y1='182' x2='170' y2='182'/%3E%3Cline x1='70' y1='238' x2='170' y2='238'/%3E%3C/g%3E%3Cline x1='30' y1='300' x2='210' y2='300' stroke='%23fff' stroke-width='2' opacity='.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center, center 46%;
  background-size: cover, auto 74%;
}

/* The line across the foot of the picture. */
#auth-screen:not(.has-backdrop) > .auth-card::after {
  content: 'Be organised. Be present. Be the church.';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 530px;
  box-sizing: border-box;
  padding: 0 34px 30px;
  color: rgba(255,255,255,.82);
  font-size: 13.5px;
  line-height: 1.45;
  letter-spacing: 0;
  pointer-events: none;
}

/* Everything the app actually rendered sits in the reserved right-hand half. */
#auth-screen:not(.has-backdrop) > .auth-card > * { padding-inline: 34px; }
#auth-screen:not(.has-backdrop) > .auth-card > *:first-child { padding-top: 34px; }
#auth-screen:not(.has-backdrop) > .auth-card > *:last-child { padding-bottom: 30px; }

/* The heading block reads better ranged left against the picture. */
#auth-screen:not(.has-backdrop) > .auth-card .auth-brand { font-size: 34px; }
#auth-screen:not(.has-backdrop) > .auth-card h1 { margin-top: 10px; }

/* A long demo-role list must not push the card off the screen. */
#auth-screen:not(.has-backdrop) > .auth-card .demo-hint { max-height: 34vh; overflow-y: auto; }

/* Below the split point the picture becomes a banner above the form. */
@media (max-width: 860px) {
  #auth-screen:not(.has-backdrop) > .auth-card {
    max-width: 430px;
    min-height: 0;
    padding: 190px 0 0;      /* the reserved half becomes a reserved strip on top */
  }
  #auth-screen:not(.has-backdrop) > .auth-card::before {
    top: 0; bottom: auto; left: 0; right: 0;
    width: auto;
    height: 190px;
    background-size: cover, auto 128px;
    background-position: center, center 42%;
  }
  #auth-screen:not(.has-backdrop) > .auth-card::after {
    top: 190px; bottom: auto; left: 0; right: 0;
    width: auto;
    transform: translateY(-100%);
    padding: 0 24px 18px;
    font-size: 12.5px;
  }
  #auth-screen:not(.has-backdrop) > .auth-card > * { padding-inline: 24px; }
  #auth-screen:not(.has-backdrop) > .auth-card > *:first-child { padding-top: 22px; }
}

/* Church OS CRM / command-center layer */
.os-hero{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:8px 0 24px}.os-hero h1,.os-hero h2{margin:4px 0 6px}.os-hero p{margin:0;max-width:720px;color:var(--muted,#737783)}.eyebrow{font-size:11px;letter-spacing:.14em;font-weight:800;color:var(--accent,#b68b3c)}.hero-actions,.row-actions{display:flex;gap:10px;align-items:center}.os-kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;margin-bottom:18px}.os-kpi{display:block;text-decoration:none;border:1px solid var(--line,#e7e8ec);background:var(--card,#fff);border-radius:16px;padding:18px;box-shadow:0 5px 20px rgba(20,25,35,.04)}.os-kpi:hover{transform:translateY(-1px)}.os-kpi-label{font-size:12px;font-weight:700;color:var(--muted,#737783)}.os-kpi-value{font-size:28px;font-weight:800;margin:8px 0 4px;color:var(--ink,#16181d)}.os-kpi-sub{font-size:11px;color:var(--muted,#737783)}.os-main-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:18px;margin-bottom:18px}.card-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.card-head h3{margin:0}.health-list>div{display:flex;justify-content:space-between;margin:14px 0}.health-bar{height:8px!important;border-radius:8px;background:#ececf0;overflow:hidden}.health-bar i{display:block;height:100%;background:var(--accent,#b68b3c);border-radius:8px}.attention-line,.event-line,.task-line{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line,#eee)}.attention-line:last-child,.event-line:last-child,.task-line:last-child{border-bottom:0}.attention-line small,.event-line small,.task-line .muted{display:block;color:var(--muted,#737783);margin-top:3px}.attention-dot{width:9px;height:9px;border-radius:50%;background:#c44;flex:none}.event-date{font-weight:800;min-width:55px}.os-timeline{position:relative}.os-timeline-item{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--line,#eee)}.os-timeline-item:last-child{border-bottom:0}.os-dot{width:9px;height:9px;border-radius:50%;background:var(--accent,#b68b3c);margin-top:6px;flex:none}.os-timeline-item small{display:block;color:var(--muted,#737783);margin-top:4px}.journey-funnel{display:grid;grid-template-columns:repeat(9,minmax(90px,1fr));gap:7px;margin-bottom:18px;overflow:auto}.journey-stage{background:var(--card,#fff);border:1px solid var(--line,#e7e8ec);padding:14px 9px;border-radius:12px;text-align:center;font-size:11px}.journey-count{font-size:21px;font-weight:800;margin-bottom:4px}.status-badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#f1f2f5;font-size:11px;font-weight:700}.grid.g3{grid-template-columns:repeat(3,1fr);margin-bottom:18px}.stat b{font-size:28px;display:block}.stat span{color:var(--muted,#737783);font-size:12px}.stat.danger b{color:#b54b4b}.row-danger{background:rgba(190,70,70,.035)}.segment-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.segment-card{min-height:180px}.segment-icon{font-size:26px;color:var(--accent,#b68b3c)}.segment-card h3{margin:8px 0}.segment-count{font-size:30px;font-weight:800}.segment-card p{color:var(--muted,#737783);font-size:12px}.person360-head{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:18px}.person-meta{display:flex;gap:7px;align-items:center;margin-top:8px;color:var(--muted,#737783)}.person360-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}.journey-current{font-size:24px;font-weight:800;margin:12px 0}.person360-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}.person360-cols h3{margin-top:0}
@media(max-width:1100px){.os-kpi-grid{grid-template-columns:repeat(3,1fr)}.journey-funnel{grid-template-columns:repeat(5,minmax(110px,1fr))}}
@media(max-width:760px){.os-hero,.person360-head{align-items:flex-start;flex-direction:column}.os-kpi-grid,.os-main-grid,.person360-grid,.person360-cols,.segment-grid,.grid.g3{grid-template-columns:1fr}.os-kpi-grid{gap:10px}.hero-actions,.row-actions{width:100%}.hero-actions .btn,.row-actions .btn{flex:1}.journey-funnel{grid-template-columns:repeat(3,minmax(110px,1fr))}}


/* ============================================================================
   GRACEHUB THEME — Church OS Demo v26
   Warm, premium church aesthetic: deep evergreen + antique gold + parchment.
   The existing functionality remains untouched; this layer is visual only.
   ============================================================================ */
:root {
  --grace-forest-950:#102C2B;
  --grace-forest-900:#173B3A;
  --grace-forest-800:#1D4A47;
  --grace-forest-700:#2B5B56;
  --grace-gold-700:#9A6B22;
  --grace-gold-600:#B78332;
  --grace-gold-500:#C99A4A;
  --grace-gold-300:#E6C982;
  --grace-cream:#F7F2E8;
  --grace-paper:#FCFAF5;
  --grace-sage:#E7EEE9;
  --tint:var(--grace-gold-600);
  --tint-press:var(--grace-gold-700);
  --accent:var(--grace-gold-600);
  --accent-soft:rgba(183,131,50,.13);
  --bg:var(--grace-cream);
  --surface:#FFFDF8;
  --surface-2:#F8F5ED;
  --border:#E7E0D2;
  --border-strong:#D8CDB9;
  --text:#20302E;
  --muted:#68716D;
  --faint:#8C948F;
  --ok:#2F6E57;
  --ok-soft:#E5F0EA;
  --warn:#9A6B22;
  --warn-soft:#F7EEDB;
  --danger:#A44B43;
  --danger-soft:#F8E8E5;
  --info:#386B78;
  --info-soft:#E5EFF1;
  --radius:14px;
  --radius-sm:9px;
  --radius-lg:20px;
  --radius-xl:28px;
  --shadow-1:0 1px 2px rgba(31,48,45,.05),0 5px 14px rgba(31,48,45,.04);
  --shadow-2:0 2px 5px rgba(31,48,45,.05),0 18px 40px rgba(31,48,45,.08);
  --shadow-3:0 18px 55px rgba(10,32,30,.24);
  --sans:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
}

body {
  background:
    radial-gradient(circle at 92% -10%, rgba(201,154,74,.10), transparent 30%),
    radial-gradient(circle at -10% 20%, rgba(43,91,86,.08), transparent 28%),
    var(--bg);
}

/* Sidebar: evergreen church identity */
#sidebar {
  background:linear-gradient(180deg,var(--grace-forest-900) 0%,var(--grace-forest-950) 100%);
  color:rgba(255,255,255,.78);
  box-shadow:8px 0 30px rgba(15,45,43,.08);
}
#sidebar .brand {
  padding-top:24px;
  padding-bottom:22px;
  border-bottom:1px solid rgba(230,201,130,.16);
}
#sidebar .brand-name {
  font-family:Georgia,'Times New Roman',serif;
  font-size:23px;
  letter-spacing:.01em;
}
#sidebar .brand-sub {
  color:var(--grace-gold-300);
  letter-spacing:.20em;
}
#nav a.active {
  background:linear-gradient(90deg,rgba(201,154,74,.23),rgba(201,154,74,.08));
  color:#F4DCA5;
  box-shadow:inset 3px 0 0 var(--grace-gold-500);
}
#nav a:hover { background:rgba(255,255,255,.065); }
#nav .nav-group { color:rgba(230,201,130,.52); }

/* Page chrome */
#main { background:transparent; }
header.page {
  background:rgba(252,250,245,.78);
  border-bottom:1px solid rgba(216,205,185,.65);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}

/* Cards become warm paper surfaces */
.card,.erp-card,.stat,.os-kpi {
  background:rgba(255,253,248,.96);
  border-color:var(--border);
  box-shadow:var(--shadow-1);
}
.card:hover,.os-kpi:hover {
  box-shadow:var(--shadow-2);
}

/* GraceHub dashboard */
.dashboard-hero {
  position:relative;
  overflow:hidden;
  padding:30px 32px 28px;
  margin-bottom:18px;
  border:1px solid rgba(216,205,185,.72);
  border-radius:24px;
  background:
    radial-gradient(circle at 88% 20%,rgba(230,201,130,.18),transparent 28%),
    linear-gradient(135deg,#173B3A 0%,#214B48 58%,#2B5B56 100%);
  box-shadow:0 18px 45px rgba(23,59,58,.16);
}
.dashboard-hero:after {
  content:'';
  position:absolute;
  width:180px;height:180px;
  right:-50px;bottom:-75px;
  border:1px solid rgba(230,201,130,.22);
  border-radius:50%;
  box-shadow:0 0 0 28px rgba(230,201,130,.045),0 0 0 56px rgba(230,201,130,.025);
  pointer-events:none;
}
.dashboard-hero h1 {
  color:#FFFDF8;
  font-family:Georgia,'Times New Roman',serif;
  font-weight:500;
  font-size:34px;
  letter-spacing:-.025em;
}
.dashboard-hero p { color:rgba(255,253,248,.72); }
.dashboard-hero .eyebrow { color:var(--grace-gold-300); }
.dashboard-hero .btn:not(.primary) {
  color:#FFFDF8;
  border-color:rgba(255,255,255,.20);
  background:rgba(255,255,255,.07);
}
.dashboard-hero .btn:not(.primary):hover { background:rgba(255,255,255,.12); }
.dashboard-hero .btn.primary {
  background:var(--grace-gold-500);
  color:#173B3A;
}

.os-kpi-grid { gap:14px; }
.os-kpi {
  position:relative;
  overflow:hidden;
  border-radius:17px;
  padding:19px;
}
.os-kpi:before {
  content:'';
  position:absolute;
  top:0;left:0;right:0;height:3px;
  background:linear-gradient(90deg,var(--grace-gold-600),var(--grace-gold-300));
  opacity:.8;
}
.os-kpi-label { color:#69746F; }
.os-kpi-value { color:var(--grace-forest-900); font-family:Georgia,'Times New Roman',serif; font-size:30px; }
.os-kpi-sub { color:#87908B; }

.eyebrow { color:var(--grace-gold-700); }
.health-card .health-bar { background:#EAE6DB; }
.health-card .health-bar i { background:linear-gradient(90deg,var(--grace-forest-700),var(--grace-gold-500)); }
.attention-dot { background:var(--grace-gold-600); box-shadow:0 0 0 4px rgba(183,131,50,.10); }
.os-dot { background:var(--grace-gold-600); }

/* Buttons */
button.primary,.btn.primary,.primary {
  background:linear-gradient(135deg,var(--grace-gold-600),var(--grace-gold-700));
  border-color:transparent;
  color:#fff;
  box-shadow:0 8px 18px rgba(154,107,34,.22);
}
button.primary:hover,.btn.primary:hover,.primary:hover {
  background:linear-gradient(135deg,var(--grace-gold-500),var(--grace-gold-600));
}
.btn,button:not(.primary) {
  border-color:var(--border-strong);
}

/* ------------------------------------------------------------- Login */
#auth-screen {
  background:
    radial-gradient(circle at 16% 16%,rgba(230,201,130,.16),transparent 25%),
    radial-gradient(circle at 85% 80%,rgba(43,91,86,.30),transparent 30%),
    linear-gradient(135deg,#102C2B 0%,#173B3A 52%,#214B48 100%);
}
#auth-screen:not(.has-backdrop) > .auth-card {
  max-width:1020px;
  min-height:590px;
  padding-left:570px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  background:#FFFDF8;
  box-shadow:0 30px 80px rgba(5,24,23,.34);
}
#auth-screen:not(.has-backdrop) > .auth-card:before {
  width:570px;
  background-color:#173B3A;
  background-image:
    linear-gradient(180deg,rgba(16,44,43,.04),rgba(16,44,43,.58)),
    radial-gradient(circle at 50% 33%,rgba(230,201,130,.22),transparent 34%),
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 600'%3E%3Cg fill='none' stroke='%23E6C982' stroke-width='1.2' opacity='.24'%3E%3Ccircle cx='210' cy='250' r='128'/%3E%3Ccircle cx='210' cy='250' r='94'/%3E%3Cpath d='M210 112v276M72 250h276M112 152l196 196M308 152L112 348'/%3E%3Cpath d='M210 132l34 72 78 9-58 51 18 77-72-39-72 39 18-77-58-51 78-9z'/%3E%3C/g%3E%3Cg fill='%23F7F2E8' opacity='.82'%3E%3Cpath d='M196 430h28V288h-28z'/%3E%3Cpath d='M168 316h84v24h-84z'/%3E%3C/g%3E%3Cpath d='M124 548V380a86 86 0 0 1 172 0v168' fill='%23F7F2E8' opacity='.055'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:center,center,center 48%;
  background-size:cover,cover,auto 88%;
}
#auth-screen:not(.has-backdrop) > .auth-card:after {
  width:570px;
  padding:0 42px 36px;
  color:rgba(255,253,248,.80);
  content:'A connected home for people, ministry, care and the work of your church.';
}
#auth-screen:not(.has-backdrop) > .auth-card > * { padding-inline:42px; }
#auth-screen:not(.has-backdrop) > .auth-card > *:first-child { padding-top:42px; }
#auth-screen:not(.has-backdrop) > .auth-card > *:last-child { padding-bottom:36px; }
.auth-card .auth-brand {
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--grace-forest-900);
  font-family:Georgia,'Times New Roman',serif;
  font-size:29px!important;
  font-weight:600;
}
.grace-mark {
  display:inline-flex;
  width:38px;height:38px;
  align-items:center;justify-content:center;
  border-radius:50%;
  color:var(--grace-gold-600);
  background:rgba(183,131,50,.11);
  border:1px solid rgba(183,131,50,.25);
  font-size:20px;
}
.grace-word { letter-spacing:-.02em; }
#auth-screen:not(.has-backdrop) > .auth-card h1 {
  font-family:Georgia,'Times New Roman',serif;
  font-size:32px;
  font-weight:500;
  color:var(--grace-forest-900);
}
#auth-screen:not(.has-backdrop) > .auth-card .muted { color:#707A75; }
#auth-screen input,
#auth-screen select,
#auth-screen textarea {
  background:#FFFEFA;
  border-color:#DDD4C4;
}
#auth-screen input:focus,
#auth-screen select:focus,
#auth-screen textarea:focus {
  border-color:var(--grace-gold-500);
  box-shadow:0 0 0 3px rgba(183,131,50,.13);
}
#auth-screen .demo-hint { border-color:#E8E0D1; }
#auth-screen .demo-role:hover { background:#F7F2E8; border-color:#D8CDB9; }

@media (max-width:860px) {
  #auth-screen:not(.has-backdrop) > .auth-card {
    max-width:470px;
    min-height:0;
    padding-left:0;
    padding-top:210px;
  }
  #auth-screen:not(.has-backdrop) > .auth-card:before {
    width:auto;height:210px;
    background-size:cover,cover,auto 170px;
  }
  #auth-screen:not(.has-backdrop) > .auth-card:after {
    width:auto;top:210px;padding:0 24px 18px;font-size:12px;
  }
  #auth-screen:not(.has-backdrop) > .auth-card > * { padding-inline:28px; }
  #auth-screen:not(.has-backdrop) > .auth-card > *:first-child { padding-top:28px; }
}

@media (prefers-color-scheme:dark) {
  :root {
    --bg:#102322;--surface:#182E2C;--surface-2:#1D3532;
    --text:#F3F0E8;--muted:#AAB3AE;--faint:#89938E;
    --border:rgba(230,201,130,.14);--border-strong:rgba(230,201,130,.25);
    --accent:var(--grace-gold-500);--accent-soft:rgba(201,154,74,.16);
  }
  body { background:var(--bg); }
  header.page { background:rgba(16,35,34,.82); }
  .card,.erp-card,.stat,.os-kpi { background:#182E2C; }
  .os-kpi-value { color:#F5EAD2; }
  #auth-screen:not(.has-backdrop) > .auth-card { background:#FDFBF6;color:#20302E; }
}


/* ============================================================================
   GRACEHUB SYSTEM-WIDE PASS — icons, charts, reports, tables, controls
   This is intentionally global: every existing module inherits the same visual
   language instead of only the login/dashboard receiving the theme.
   ============================================================================ */

/* Icons: the glyph tiles are still section-aware, but the palette is now
   restrained to GraceHub's evergreen / gold / sage / clay family. */
nav a .ico,
.ico {
  border-radius:8px;
  box-shadow:inset 0 -1px 1px rgba(16,44,43,.14),0 2px 5px rgba(16,44,43,.10);
}
nav a .ico svg,.ico svg { stroke-width:1.75; }
nav a:hover .ico { filter:saturate(.82) brightness(1.04); }
nav a.active .ico {
  box-shadow:inset 0 -1px 1px rgba(16,44,43,.16),0 3px 8px rgba(16,44,43,.18);
}

/* All chart primitives use the GraceHub palette. */
.bar-track { background:#E9E4D9; }
.bar-fill { background:linear-gradient(90deg,var(--grace-forest-700),var(--grace-gold-500)); }
.chart { gap:9px; }
.chart .col .bar {
  background:linear-gradient(180deg,var(--grace-gold-500),var(--grace-gold-700));
  border-radius:8px 8px 4px 4px;
  box-shadow:0 5px 12px rgba(154,107,34,.14);
}
.chart .col .val { color:var(--grace-forest-900); }
.chart .col .cap { color:var(--muted); }

/* Report pages: make every report feel like part of the same product. */
.report-head {
  padding:18px 20px;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(135deg,rgba(255,253,248,.98),rgba(247,242,232,.86));
  box-shadow:var(--shadow-1);
}
#view .report-head h2,
#view .card > h3,
#view .card > h2 {
  color:var(--grace-forest-900);
}
#view .report-head + .grid .stat,
#view .grid.g4 .stat,
#view .grid.g3 .stat {
  border-top:3px solid var(--grace-gold-500);
}
#view .report-head ~ .card,
#view .report-head ~ .grid .card {
  border-color:var(--border);
}
#view table thead th {
  background:#F3EEE4;
  color:var(--grace-forest-800);
  border-bottom-color:var(--border-strong);
}
#view table tbody tr:hover { background:#FBF7EF; }

/* Reports and data tables use subtle gold/evergreen emphasis rather than
   generic blue application chrome. */
#view .toolbar select,
#view .toolbar input {
  background:#FFFEFA;
  border-color:var(--border-strong);
}
#view .toolbar select:focus,
#view .toolbar input:focus {
  border-color:var(--grace-gold-500);
  box-shadow:0 0 0 3px rgba(183,131,50,.12);
}

/* Pills / status indicators. */
.pill.accent,.status-badge {
  background:rgba(183,131,50,.12);
  color:var(--grace-gold-700);
}
.pill.ok { background:var(--ok-soft); color:var(--grace-forest-700); }
.pill.info { background:var(--info-soft); color:var(--grace-forest-700); }

/* Links and selected controls. */
a { color:var(--grace-forest-700); }
a:hover { color:var(--grace-gold-700); }
.tabs button.active {
  color:var(--grace-forest-900);
  border-bottom-color:var(--grace-gold-500);
}

/* Progress / health visuals. */
.progress,.health-bar { background:#E8E3D8; }
.progress > i,.health-bar i {
  background:linear-gradient(90deg,var(--grace-forest-700),var(--grace-gold-500));
}

/* Cards across every module. */
.card,.erp-card,.stat {
  border-radius:18px;
  background:rgba(255,253,248,.97);
}
.card > h3:first-child { letter-spacing:-.01em; }

/* Form controls across all screens. */
input,select,textarea {
  background:#FFFEFA;
  border-color:var(--border-strong);
  color:var(--text);
}
input:focus,select:focus,textarea:focus {
  border-color:var(--grace-gold-500);
  box-shadow:0 0 0 3px rgba(183,131,50,.12);
}
input[type="checkbox"],input[type="radio"] { accent-color:var(--grace-gold-600); }

/* Modal and drawer chrome. */
.modal,.drawer {
  border-color:var(--border);
  box-shadow:0 25px 70px rgba(16,44,43,.22);
}
.modal-head,.drawer-head { background:#F7F2E8; border-bottom-color:var(--border); }

/* Toasts / notices. */
.toast { border-color:var(--border); box-shadow:var(--shadow-2); }

/* Dashboard / CRM additions inherit the same paper-and-evergreen treatment. */
.os-kpi,
.journey-stage,
.segment-card {
  background:linear-gradient(180deg,#FFFDF8 0%,#FBF8F0 100%);
  border-color:var(--border);
}
.journey-stage { box-shadow:inset 0 2px 0 rgba(201,154,74,.18); }
.segment-icon { color:var(--grace-gold-600); }

/* Print/report output keeps the GraceHub identity. */
@media print {
  body { background:#fff !important; color:#20302E !important; }
  .report-head { border:1px solid #D8CDB9 !important; box-shadow:none !important; }
  #view table thead th { background:#F3EEE4 !important; }
  .chart .col .bar { background:#B78332 !important; box-shadow:none !important; }
}

/* ==========================================================================
   GRACEHUB REFERENCE MATCH — v28
   The supplied GraceHub reference is the visual source of truth for the shell,
   login and dashboard. This pass intentionally overrides the earlier dark/copper
   skin so the entire product reads as one light, editorial church workspace.
   ========================================================================== */
:root {
  --gh-navy:#102344; --gh-navy-2:#1A3158; --gh-gold:#B78935; --gh-gold-2:#D1A64D;
  --gh-cream:#F7F4EC; --gh-paper:#FFFDFC; --gh-line:#E8E4DA; --gh-muted:#6E7788;
  --gh-green:#16865A; --gh-purple:#6B4CC2; --gh-blue:#2755A6;
  --bg:var(--gh-cream); --surface:#FFFFFF; --surface-2:#FBFAF6; --text:var(--gh-navy);
  --muted:var(--gh-muted); --faint:#8B93A1; --border:var(--gh-line); --border-strong:#D9D4C8;
  --tint:var(--gh-gold); --tint-press:#9B7126; --accent:var(--gh-gold); --accent-soft:rgba(183,137,53,.12);
  --radius:14px; --radius-sm:10px; --radius-lg:18px; --radius-xl:24px;
  --shadow-1:0 1px 2px rgba(18,35,64,.04),0 5px 18px rgba(18,35,64,.05);
  --shadow-2:0 1px 2px rgba(18,35,64,.04),0 10px 30px rgba(18,35,64,.07);
  --sans:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
}
body { background:var(--gh-cream); color:var(--gh-navy); }
#app { background:var(--gh-cream); }
#sidebar { width:220px; flex-basis:220px; background:#fff; color:var(--gh-navy); border-right:1px solid var(--gh-line); box-shadow:none; }
.brand { padding:20px 16px 16px; min-height:88px; border-bottom:0!important; align-items:flex-start; }
.brand:before { content:'✦'; display:flex; width:34px; height:34px; align-items:center; justify-content:center; position:absolute; margin-top:1px; border-radius:50%; color:var(--gh-gold); font-size:21px; background:#F7F0DF; border:1px solid #E7D7B6; }
.brand-name { padding-left:43px; color:var(--gh-navy)!important; font-family:Georgia,'Times New Roman',serif; font-size:22px!important; line-height:1.1; font-weight:700!important; }
.brand-sub { padding-left:43px; color:#657086!important; font-size:8px!important; letter-spacing:.10em!important; margin-top:4px; white-space:nowrap; }
nav { padding:14px 10px 24px; }
.nav-group { color:#8A8F99!important; padding:15px 12px 6px!important; font-size:9px!important; letter-spacing:.13em!important; }
nav a { color:var(--gh-navy)!important; gap:11px; padding:10px 12px; border-radius:11px; font-size:13.5px; }
nav a:hover { background:#F6F2E9!important; }
nav a.active { background:#F3EEE4!important; color:var(--gh-navy)!important; box-shadow:inset 3px 0 0 var(--gh-gold); font-weight:700; }
nav a .ico { width:20px!important; height:20px!important; display:flex; align-items:center; justify-content:center; border-radius:0!important; background:transparent!important; color:var(--gh-navy)!important; box-shadow:none!important; opacity:1!important; }
nav a .ico svg { width:18px!important; height:18px!important; stroke:currentColor!important; stroke-width:1.8; }
nav a.active .ico { color:var(--gh-navy)!important; }
nav a .count { background:#EEF0F3!important; color:#697386!important; padding:2px 7px!important; }
#main { background:var(--gh-cream); }
header.page { display:none!important; }
#view { padding:0 18px 60px; max-width:1500px; width:100%; margin:0 auto; }
.card,.erp-card { background:#fff; border-color:var(--gh-line); box-shadow:var(--shadow-1); border-radius:14px; }
button.primary,.btn.primary,.primary { background:linear-gradient(135deg,#C4973E,#AE7C29)!important; border:0!important; }

/* Login */
#auth-screen { padding:30px; background:#F5F2EA!important; }
#auth-screen:not(.has-backdrop) > .auth-card { max-width:1240px!important; min-height:700px!important; width:min(1240px,96vw); padding:0!important; display:grid!important; grid-template-columns:52% 48%; overflow:hidden; border:1px solid #E8E2D6!important; border-radius:26px!important; background:#fff!important; box-shadow:0 25px 80px rgba(16,35,68,.15)!important; }
#auth-screen:not(.has-backdrop) > .auth-card:before, #auth-screen:not(.has-backdrop) > .auth-card:after { display:none!important; }
.auth-visual { position:relative; min-height:700px; padding:46px 60px; display:flex; flex-direction:column; justify-content:space-between; overflow:hidden; color:#fff; background-image:linear-gradient(180deg,rgba(7,20,34,.22),rgba(7,20,34,.74)),url('../assets/gracehub-login.jpg'); background-size:cover; background-position:center; }
.auth-visual:after { content:''; position:absolute; inset:auto -10% -22% -10%; height:45%; background:radial-gradient(ellipse at center,rgba(0,0,0,.1),transparent 65%); pointer-events:none; }
.auth-visual-kicker { position:relative; z-index:1; font-size:10px; letter-spacing:.27em; line-height:2; color:rgba(255,255,255,.92); }
.auth-visual-copy { position:relative; z-index:1; max-width:520px; }
.auth-visual-title { font-family:Georgia,'Times New Roman',serif; font-size:58px; line-height:.98; letter-spacing:-.035em; }
.auth-visual-title span { color:#D7B15B; }
.auth-visual-rule { width:74px; height:4px; background:#D7B15B; margin:28px 0 22px; }
.auth-visual-copy p { max-width:470px; margin:0; font-size:17px; line-height:1.55; color:rgba(255,255,255,.91); }
.auth-visual-features { display:grid; grid-template-columns:repeat(5,1fr); gap:18px; margin-top:34px; }
.auth-visual-features span { font-size:11px; font-weight:600; color:#fff; padding-top:26px; position:relative; }
.auth-visual-features span:before { content:'○'; position:absolute; top:0; left:0; font-size:21px; color:#fff; }
.auth-content { min-width:0; padding:58px 64px 42px; overflow:auto; background:#fff; }
.auth-content > * { padding-inline:0!important; }
.auth-content > *:first-child { padding-top:0!important; }
.auth-content > *:last-child { padding-bottom:0!important; }
.auth-card .auth-brand { color:var(--gh-navy)!important; font-family:Georgia,'Times New Roman',serif; font-size:31px!important; justify-content:flex-start; }
.auth-card .grace-mark { color:var(--gh-gold); background:#F7F0DF; border-color:#E7D7B6; }
#auth-screen:not(.has-backdrop) > .auth-card h1 { color:var(--gh-navy); font-size:38px; margin-top:28px; }
#auth-screen .muted { color:#758096!important; }
#auth-screen input,#auth-screen select,#auth-screen textarea { background:#fff!important; border:1px solid #D9DEE6!important; border-radius:11px!important; min-height:50px; }
#auth-screen input:focus { border-color:var(--gh-gold)!important; box-shadow:0 0 0 3px rgba(183,137,53,.12)!important; }
#auth-screen .demo-hint { margin-top:30px; border-top:1px solid var(--gh-line); padding-top:22px; border-radius:0!important; }
#auth-screen .demo-role { border-color:#E4DFD4; background:#FFFEFB; border-radius:12px; margin-top:8px; }
#auth-screen .demo-role:hover { background:#F8F4EB; border-color:#D6C8AA; }
#auth-screen .primary { min-height:50px; border-radius:10px!important; }

/* Dashboard */
.gh-dashboard { color:var(--gh-navy); }
.gh-topbar { height:66px; display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 -18px; padding:0 24px; background:#fff; border-bottom:1px solid var(--gh-line); }
.gh-search { width:min(470px,45%); height:42px; display:flex; align-items:center; gap:10px; background:#F6F7F8; border:1px solid #E8E9EC; border-radius:14px; padding:0 14px; }
.gh-search span { font-size:24px; color:#647086; line-height:1; transform:rotate(-20deg); }
.gh-search input { border:0!important; outline:0; background:transparent!important; min-height:0!important; height:38px; width:100%; font:inherit; color:var(--gh-navy); }
.gh-top-actions { display:flex; align-items:center; gap:12px; }
.gh-church-switch,.gh-user,.gh-icon-btn { border:1px solid #E5E7EB; background:#fff; color:var(--gh-navy); border-radius:10px; min-height:42px; }
.gh-church-switch { display:flex; align-items:center; gap:10px; padding:5px 12px; text-align:left; }
.gh-church-switch strong,.gh-user strong { display:block; font-size:11px; }
.gh-church-switch small,.gh-user small { display:block; font-size:10px; color:#758096; margin-top:2px; }
.gh-church-switch b,.gh-user b { margin-left:8px; color:#7D8797; }
.gh-church-mark { width:26px; height:30px; display:grid; place-items:center; color:var(--gh-gold); font-size:22px; }
.gh-icon-btn { position:relative; width:44px; font-size:20px; border:0; }
.gh-icon-btn em { position:absolute; top:2px; right:4px; min-width:17px; height:17px; padding:0 4px; border-radius:999px; display:grid; place-items:center; background:#E75B52; color:#fff; font-style:normal; font-size:9px; }
.gh-user { display:flex; align-items:center; gap:9px; border:0; padding:3px 0 3px 4px; }
.gh-avatar { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:#E8EDF5; color:var(--gh-navy); font-weight:800; font-size:11px; }
.gh-welcome { min-height:142px; display:flex; align-items:center; justify-content:space-between; padding:26px 14px 20px; background:linear-gradient(90deg,#FBFAF6 0%,#FBFAF6 68%,rgba(251,250,246,.76) 100%),url('../assets/gracehub-church.jpg'); background-repeat:no-repeat; background-position:center, right center; background-size:cover, auto 100%; }
.gh-eyebrow { color:var(--gh-gold); font-size:10px; font-weight:800; letter-spacing:.16em; }
.gh-welcome h1 { font-size:37px; margin:5px 0 2px; letter-spacing:-.035em; }
.gh-welcome h1 span { font-size:28px; }
.gh-welcome h2 { font-size:20px; margin:0 0 3px; }
.gh-welcome p { margin:0; color:#657086; font-size:13px; }
.gh-verse { text-align:center; max-width:400px; font-family:Georgia,'Times New Roman',serif; font-style:italic; font-size:14px; line-height:1.45; color:#2D3850; padding-right:22px; }
.gh-verse small { display:block; font-family:var(--sans); font-style:normal; margin-top:6px; color:#67748A; font-size:10px; }
.gh-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin:0 0 16px; }
.gh-kpi { min-height:118px; background:#fff; border:1px solid #ECE8E0; border-radius:14px; padding:20px; display:flex; gap:15px; align-items:center; text-decoration:none; color:var(--gh-navy); box-shadow:var(--shadow-1); }
.gh-kpi:hover { transform:translateY(-1px); box-shadow:var(--shadow-2); }
.gh-kpi-icon { width:58px; height:58px; border-radius:50%; display:grid; place-items:center; font-size:26px; flex:none; }
.gh-kpi-icon.blue { background:#E7F0FF; color:#2454A4; } .gh-kpi-icon.green{background:#E4F4EC;color:#147D56;} .gh-kpi-icon.gold{background:#FFF0D4;color:#B17816;} .gh-kpi-icon.purple{background:#F0E9FF;color:#6244B3;}
.gh-kpi small { display:block; font-size:11px; font-weight:700; } .gh-kpi strong { display:block; font-size:25px; margin:4px 0 1px; letter-spacing:-.03em; } .gh-kpi i{display:block;color:#15855A;font-size:11px;font-style:normal;font-weight:700;} .gh-kpi em{display:block;color:#7A8493;font-size:10px;font-style:normal;margin-top:2px;}
.gh-grid { display:grid; gap:16px; }
.gh-main { grid-template-columns:1.05fr .95fr; margin-bottom:16px; }
.gh-lower { grid-template-columns:1fr 1fr 310px; }
.gh-card { background:#fff; border:1px solid #ECE8E0; border-radius:14px; padding:18px 20px; box-shadow:var(--shadow-1); min-width:0; }
.gh-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px; }
.gh-card-head > div:first-child { display:flex; gap:10px; align-items:center; }
.gh-card-head h3 { margin:0; font-size:14px; } .gh-card-head p{margin:2px 0 0;color:#7A8493;font-size:10px;}
.gh-mini-icon { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; font-size:17px; flex:none; } .gh-mini-icon.blue{background:#E7F0FF;color:#2454A4;} .gh-mini-icon.gold{background:#FFF0D4;color:#B17816;} .gh-mini-icon.green{background:#E4F4EC;color:#147D56;}
.gh-select { border:1px solid #E3E5E8; background:#fff; border-radius:8px; padding:7px 10px; font-size:10px; color:#4E5B70; } .gh-link{font-size:11px;color:#A87822;text-decoration:none;padding-top:5px;}
.gh-chart { height:190px; } .gh-chart svg{width:100%;height:100%;overflow:visible;} .gh-grid-line{stroke:#E9ECF1;stroke-width:1;} .gh-axis{fill:#758096;font-size:9px;font-family:var(--sans);} .gh-area{fill:rgba(26,129,88,.10);} .gh-line{stroke:#16865A;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;} .gh-point{fill:#16865A;stroke:#fff;stroke-width:2;}
.gh-bars { height:190px; display:flex; align-items:flex-end; gap:16px; padding:4px 8px 0; border-bottom:1px solid #E7E9ED; } .gh-bar-item{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px;} .gh-bar-value{font-size:9px;color:#6D7788;min-height:12px;} .gh-bar-track{width:min(44px,100%);height:140px;display:flex;align-items:flex-end;background:linear-gradient(to top,transparent 0,transparent 24.5%,#EEF0F3 25%,transparent 25.5%,transparent 49.5%,#EEF0F3 50%,transparent 50.5%,transparent 74.5%,#EEF0F3 75%,transparent 75.5%);border-radius:8px 8px 0 0;overflow:hidden;} .gh-bar-track i{display:block;width:100%;background:linear-gradient(180deg,#D1A64D,#B78935);border-radius:7px 7px 0 0;} .gh-bar-label{font-size:9px;color:#758096;margin-bottom:3px;} .gh-chart-empty,.gh-empty{display:grid;place-items:center;min-height:140px;color:#8992A0;font-size:11px;}
.gh-event-list,.gh-activity-list{display:flex;flex-direction:column;} .gh-event{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #ECEEF1;text-decoration:none;color:var(--gh-navy);} .gh-event:last-child,.gh-activity:last-child{border-bottom:0;} .gh-date{width:46px;height:50px;border-radius:8px;background:#FFF1F0;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;color:#A52323;} .gh-date b{font-size:8px;} .gh-date strong{font-size:17px;line-height:1;} .gh-event > span:nth-child(2){min-width:0;flex:1;} .gh-event strong{display:block;font-size:11px;} .gh-event small{display:block;color:#6F798B;font-size:9px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .gh-event em{font-size:9px;font-style:normal;background:#EAF7EF;color:#16865A;border-radius:999px;padding:4px 8px;}
.gh-activity{display:flex;gap:10px;align-items:flex-start;padding:11px 0;border-bottom:1px solid #ECEEF1;} .gh-activity-icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#EEF4FF;color:#2755A6;font-size:13px;flex:none;} .gh-activity strong{display:block;font-size:10px;line-height:1.35;} .gh-activity small{display:block;color:#758096;font-size:9px;margin-top:3px;}
.gh-progress{display:flex;align-items:center;gap:12px;margin:4px 0 14px;} .gh-progress>div{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#16865A var(--pct),#E7ECE9 0);position:relative;flex:none;} .gh-progress>div:after{content:'';position:absolute;inset:8px;background:#fff;border-radius:50%;} .gh-progress>div span{position:relative;z-index:1;font-size:12px;font-weight:800;} .gh-progress section strong{font-size:11px;} .gh-progress section p{font-size:9px;color:#758096;line-height:1.45;margin:4px 0 0;} .gh-setup ul{list-style:none;margin:0 0 14px;padding:0;} .gh-setup li{font-size:9px;padding:5px 0;display:flex;gap:8px;align-items:center;color:#4E5B70;} .gh-setup li span{width:16px;height:16px;border-radius:50%;border:1px solid #BFC6D0;display:grid;place-items:center;font-size:9px;} .gh-setup li.done span{background:#16865A;border-color:#16865A;color:#fff;} .gh-gold-btn{display:block;text-align:center;background:linear-gradient(135deg,#C69A40,#B17C2A);color:#fff;border-radius:8px;padding:9px;text-decoration:none;font-size:10px;font-weight:700;}
.gh-promo{min-height:205px;margin-top:16px;border-radius:14px;overflow:hidden;background-image:linear-gradient(90deg,rgba(12,29,47,.88),rgba(12,29,47,.34)),url('../assets/gracehub-promo.jpg');background-size:cover;background-position:center;display:flex;align-items:center;padding:26px 32px;box-shadow:var(--shadow-1);} .gh-promo-copy{max-width:390px;color:#fff;} .gh-promo-copy>span{font-size:9px;letter-spacing:.22em;} .gh-promo-copy h3{font-family:Georgia,serif;font-size:27px;line-height:1.05;margin:7px 0 8px;} .gh-promo-copy p{font-size:10px;line-height:1.5;color:rgba(255,255,255,.84);margin:0 0 14px;} .gh-promo-copy a{display:inline-block;background:#102344;color:#fff;padding:9px 14px;border-radius:7px;text-decoration:none;font-size:10px;}
.gh-footer{display:flex;justify-content:space-between;color:#7A8493;font-size:9px;padding:14px 4px 0;} .gh-footer strong{color:var(--gh-navy);} .gh-footer span{margin-left:auto;}
@media(max-width:1100px){.gh-lower{grid-template-columns:1fr 1fr}.gh-setup{grid-column:1/-1}.gh-kpis{grid-template-columns:repeat(2,1fr)}.gh-search{width:42%;}.gh-welcome{background:#FBFAF6;}.gh-verse{display:none;}}
@media(max-width:860px){#sidebar{width:250px;flex-basis:250px}.gh-topbar{height:auto;min-height:60px;padding:10px 14px;align-items:stretch}.gh-search{width:100%;order:2}.gh-top-actions{order:1}.gh-church-switch{display:none}.gh-user span{display:none}.gh-welcome{padding:22px 6px}.gh-welcome h1{font-size:29px}.gh-main,.gh-lower{grid-template-columns:1fr}.gh-kpis{grid-template-columns:1fr 1fr}.gh-footer{display:block}.gh-footer span{display:block;margin:5px 0 0}.auth-visual{min-height:320px;padding:28px}.auth-visual-title{font-size:42px}.auth-visual-copy p{font-size:13px}.auth-visual-features{display:none}#auth-screen:not(.has-backdrop) > .auth-card{grid-template-columns:1fr;min-height:0;max-height:94vh}.auth-content{padding:34px 28px;}.auth-visual-kicker{font-size:8px}.auth-visual{min-height:310px;}.gh-promo{min-height:220px;}}
@media(max-width:560px){#view{padding:0 10px 60px}.gh-topbar{margin:0 -10px;padding:8px 10px;flex-wrap:wrap}.gh-search{order:2;width:100%}.gh-top-actions{order:1;width:100%;justify-content:flex-end}.gh-kpis{grid-template-columns:1fr}.gh-kpi{min-height:96px}.gh-welcome h1{font-size:25px}.gh-welcome h2{font-size:16px}.gh-card{padding:15px}.gh-promo-copy h3{font-size:24px}.auth-visual{min-height:250px}.auth-visual-title{font-size:35px}.auth-content{padding:26px 22px;}#auth-screen{padding:12px}.gh-verse{display:none;}}

/* GraceHub component language for every non-dashboard module. */
button,.btn,input,select,textarea { font-family:var(--sans); }
button,.btn { border-radius:9px; }
button:not(.primary):not(.gh-select):not(.gh-icon-btn), .btn:not(.primary) { background:#fff; color:var(--gh-navy); border-color:#D9DDE5; }
button:not(.primary):hover,.btn:not(.primary):hover { background:#F7F4EC; border-color:#CFC8B8; }
input,select,textarea { border-radius:10px!important; border:1px solid #D9DDE5!important; background:#fff!important; color:var(--gh-navy)!important; }
input:focus,select:focus,textarea:focus { border-color:var(--gh-gold)!important; box-shadow:0 0 0 3px rgba(183,137,53,.11)!important; outline:0; }
.toolbar,.filters,.filterbar { background:#fff; border-color:var(--gh-line); border-radius:12px; }
table { border-color:var(--gh-line)!important; }
table thead th { background:#F7F4EC!important; color:#5D6676!important; font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
table tbody tr:hover { background:#FBFAF6!important; }
.pill,.status-badge { border-radius:999px!important; }
.tabs { border-bottom-color:var(--gh-line)!important; }
.tabs button.active { color:var(--gh-navy)!important; border-bottom-color:var(--gh-gold)!important; }
.banner { border-radius:10px!important; }
.modal-backdrop { background:rgba(16,35,68,.32)!important; }
.modal { border:1px solid var(--gh-line)!important; border-radius:18px!important; box-shadow:0 24px 70px rgba(16,35,68,.18)!important; }
.modal-head { background:#FBFAF6!important; border-bottom:1px solid var(--gh-line)!important; }
.modal-foot { background:#FBFAF6!important; border-top:1px solid var(--gh-line)!important; }
.report-head { background:linear-gradient(135deg,#fff,#F7F4EC)!important; border-color:var(--gh-line)!important; }
.report-head h2,.report-head h3 { color:var(--gh-navy)!important; font-family:Georgia,'Times New Roman',serif; }
.stat { background:#fff!important; border-color:var(--gh-line)!important; }
.stat .label { color:#6F7888!important; }
.stat .value { color:var(--gh-navy)!important; font-family:Georgia,'Times New Roman',serif; }
.bar-fill { background:linear-gradient(90deg,#16865A,#B78935)!important; }
.bar-track { background:#E9E5DC!important; }
.age-tile { background:#fff!important; border-color:var(--gh-line)!important; }
.age-tile:hover { background:#F7F4EC!important; border-color:#D4C8AF!important; }
.toast { border-radius:10px!important; }
@media print { #sidebar,.gh-topbar { display:none!important; } #main,#view { background:#fff!important; } }


/* =======================================================================
   GraceHub v29 — layout correction pass
   ======================================================================= */
:root{
  --gh-navy:#102344;
  --gh-gold:#B78935;
  --gh-gold-2:#D1A64D;
  --gh-cream:#F7F4EC;
  --gh-paper:#FFFDFC;
  --gh-line:#E8E4DA;
  --gh-muted:#6E7788;
  --gh-green:#16865A;
}

/* The page header belongs to every module except the dashboard. Hiding it
   globally was the cause of screens starting underneath the chrome and their
   + actions disappearing. */
header.page{
  display:flex!important;
  position:sticky;
  top:0;
  z-index:50;
  min-height:72px;
  box-sizing:border-box;
  padding:16px 28px 14px;
  align-items:center;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--gh-line);
  box-shadow:0 2px 10px rgba(16,35,68,.035);
}
body[data-route="dashboard"] header.page{display:none!important;}
header.page #page-title{min-width:0;}
header.page #page-title h1{font-family:var(--sans);font-size:24px;line-height:1.2;font-weight:700;color:var(--gh-navy);margin:0;}
header.page #page-title .sub{font-size:12px;color:var(--gh-muted);margin-top:4px;}
header.page .actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto;}
header.page .actions button{white-space:nowrap;}
header.page .actions .primary{display:inline-flex;align-items:center;gap:7px;}

/* Account controls stay visible at the bottom of the sidebar instead of being
   part of the long scrolling navigation list. */
#sidebar{overflow:hidden!important;}
#nav{min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:thin;}
#account-footer{flex:0 0 auto;background:#fff;border-top:1px solid var(--gh-line);padding:13px 14px 15px;}
.account-name{font-size:12px;font-weight:800;color:var(--gh-navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.account-role{font-size:10px;color:var(--gh-muted);margin-top:2px;}
.account-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;margin-top:10px;}
.account-action{min-height:32px!important;padding:5px 7px!important;border:1px solid #E0DDD5!important;background:#fff!important;color:var(--gh-navy)!important;border-radius:8px!important;font-size:10px!important;font-weight:700!important;}
.account-action:hover{background:#F7F4EC!important;border-color:#D5C9AF!important;}
.account-action.danger{color:#9A4039!important;}

/* Never allow generic content rows to create horizontal bleed. */
#view,.card,.erp-card,.toolbar,.filters,.filterbar,.table-wrap{min-width:0;box-sizing:border-box;}
#view{overflow-x:hidden;}
.row{min-width:0;}
.card{overflow:hidden;}
.card h1,.card h2,.card h3,.card p,.card td,.card th,.toolbar,.filters,.filterbar{overflow-wrap:anywhere;}

/* Birthday/month and other repeating tiles: equal geometry, no text escaping
   into the neighbouring tile. */
.month-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;align-items:stretch;}
.month-card{width:100%;min-width:0;box-sizing:border-box;overflow:hidden;min-height:76px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:8px;align-content:center;}
.month-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.month-count{grid-column:2;grid-row:1 / span 2;align-self:center;}
.month-sub{grid-column:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* Consistent module toolbar. */
.toolbar,.filters,.filterbar{padding:12px 14px!important;margin-bottom:16px!important;box-shadow:var(--shadow-1);}
.toolbar .spacer,.filters .spacer,.filterbar .spacer{flex:1 1 auto;min-width:12px;}

/* Buttons with an action should read as actions. Existing modules already use
   '+ Add...' labels; keep them visible in the restored page header. */
header.page .actions button.primary:before{content:none;}

/* Dashboard — match the GraceHub reference composition, with real icons and
   stable card geometry. */
.gh-dashboard{max-width:1280px;margin:0 auto;padding-bottom:24px;}
.gh-topbar{margin:0 -18px!important;padding:0 24px!important;}
.gh-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
.gh-kpi{min-width:0;min-height:118px;box-sizing:border-box;}
.gh-kpi-icon{width:58px;height:58px;}
.gh-kpi-icon .ico,.gh-mini-icon .ico,.gh-activity-icon .ico{background:transparent!important;color:currentColor!important;box-shadow:none!important;width:24px!important;height:24px!important;border-radius:0!important;display:flex!important;}
.gh-kpi-icon .ico svg,.gh-mini-icon .ico svg,.gh-activity-icon .ico svg{width:24px!important;height:24px!important;stroke:currentColor!important;}
.gh-main{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;}
.gh-lower{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 300px!important;}
.gh-card{min-width:0;box-sizing:border-box;}
.gh-card-head>div:first-child{min-width:0;}
.gh-card-head>div:first-child>div{min-width:0;}
.gh-card-head h3,.gh-card-head p{white-space:normal;overflow-wrap:anywhere;}
.gh-chart{height:210px;min-height:0;}
.gh-bars{height:210px;}
.gh-event,.gh-activity{min-width:0;}
.gh-event>span:nth-child(2),.gh-activity>span:nth-child(2){min-width:0;}
.gh-event small,.gh-activity strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;}
.gh-promo{box-sizing:border-box;}

/* Login: the supplied GraceHub artwork already contains the complete left
   editorial composition. Rendering the same text in HTML caused the visible
   double/bleeding title and feature labels. */
#auth-screen{padding:20px!important;background:#F5F2EA!important;overflow:auto!important;}
#auth-screen:not(.has-backdrop)>.auth-card{width:min(1540px,calc(100vw - 40px))!important;max-width:1540px!important;height:min(900px,calc(100vh - 40px))!important;min-height:0!important;display:grid!important;grid-template-columns:minmax(0,52%) minmax(520px,48%)!important;padding:0!important;border-radius:22px!important;overflow:hidden!important;}
#auth-screen:not(.has-backdrop)>.auth-card .auth-visual{min-height:0!important;height:100%!important;padding:0!important;background-image:url('../assets/gracehub-login.jpg')!important;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important;}
#auth-screen:not(.has-backdrop)>.auth-card .auth-visual:after{display:none!important;}
.auth-content{min-width:0!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:46px 52px 36px!important;box-sizing:border-box;}
.auth-content .demo-hint{padding-bottom:8px;}
#auth-screen .demo-role{box-sizing:border-box;min-width:0;}
#auth-screen .auth-brand{display:flex;align-items:center;gap:12px;}

@media(max-width:1100px){
  .gh-lower{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;}
  .gh-setup{grid-column:1/-1;}
  .gh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #auth-screen:not(.has-backdrop)>.auth-card{grid-template-columns:48% 52%!important;}
  .auth-content{padding:40px 38px 30px!important;}
}
@media(max-width:860px){
  header.page{position:static;min-height:64px;padding:13px 18px;}
  header.page .actions{width:100%;justify-content:flex-start;margin-left:0;}
  #nav{padding-bottom:8px;}
  #account-footer{padding-bottom:calc(15px + env(safe-area-inset-bottom));}
  .account-actions{grid-template-columns:1fr 1fr 1fr;}
  .gh-main,.gh-lower{grid-template-columns:1fr!important;}
  .gh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  #auth-screen:not(.has-backdrop)>.auth-card{width:min(680px,calc(100vw - 24px))!important;height:auto!important;max-height:none!important;grid-template-columns:1fr!important;}
  #auth-screen:not(.has-backdrop)>.auth-card .auth-visual{min-height:330px!important;height:330px!important;}
  .auth-content{padding:34px 30px!important;max-height:calc(100vh - 354px);}
}
@media(max-width:560px){
  #view{padding:16px 12px 76px!important;}
  header.page #page-title h1{font-size:20px;}
  .account-actions{grid-template-columns:1fr;}
  .gh-kpis{grid-template-columns:1fr!important;}
  .gh-kpi{min-height:100px;}
  .month-grid{grid-template-columns:1fr!important;}
  #auth-screen{padding:10px!important;}
  #auth-screen:not(.has-backdrop)>.auth-card{width:100%!important;grid-template-columns:1fr!important;border-radius:18px!important;}
  #auth-screen:not(.has-backdrop)>.auth-card .auth-visual{min-height:230px!important;height:230px!important;background-position:center top!important;}
  .auth-content{padding:28px 22px!important;max-height:none;}
}

/* =======================================================================
   GraceHub v30 — dashboard composition pass
   The dashboard is the church command centre: calm, editorial, actionable,
   and data-rich without becoming a wall of widgets.
   ======================================================================= */
.gh-dashboard{max-width:1320px;margin:0 auto;padding:0 0 30px;color:var(--gh-navy)}
.gh-topbar{min-height:66px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px;margin:0 -18px 8px!important;border-bottom:1px solid #EEEAE2;background:rgba(255,255,255,.92);box-shadow:0 1px 0 rgba(16,35,68,.02)}
.gh-search{display:flex;align-items:center;gap:10px;width:min(520px,52%);height:42px;padding:0 14px;border:1px solid #E4E1D9;border-radius:12px;background:#F8F7F4;box-sizing:border-box}
.gh-search>span{display:grid;place-items:center;color:#617084;flex:none}.gh-search .gh-search-icon,.gh-search .gh-search-icon .ico{width:19px!important;height:19px!important;background:transparent!important;box-shadow:none!important}.gh-search .gh-search-icon svg{width:19px!important;height:19px!important;stroke:currentColor!important}
.gh-search input{border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;width:100%;height:100%;padding:0!important;font-size:12px;color:var(--gh-navy)!important}.gh-search input::placeholder{color:#8A93A1}
.gh-top-actions{display:flex;align-items:center;gap:10px;min-width:0}.gh-church-switch,.gh-user,.gh-icon-btn{border:1px solid #E4E1D9!important;background:#fff!important;color:var(--gh-navy)!important;box-shadow:none!important}
.gh-church-switch{display:flex;align-items:center;gap:9px;padding:7px 11px;border-radius:11px!important;text-align:left;min-width:230px}.gh-church-switch .gh-church-mark{width:30px;height:30px;border-radius:9px;background:#F5EFE1;color:var(--gh-gold);display:grid;place-items:center;flex:none}.gh-church-mark .ico{background:transparent!important;box-shadow:none!important;width:20px!important;height:20px!important}.gh-church-mark svg{width:20px!important;height:20px!important}.gh-church-switch>span:nth-child(2){display:flex;flex-direction:column;min-width:0}.gh-church-switch strong,.gh-user strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gh-church-switch small,.gh-user small{font-size:9px;color:#788394;margin-top:2px;white-space:nowrap}.gh-church-switch>b,.gh-user>b{font-size:12px;color:#788394;margin-left:auto}.gh-icon-btn{position:relative;width:42px;height:42px;border-radius:11px!important;display:grid;place-items:center}.gh-icon-btn .ico{background:transparent!important;box-shadow:none!important;width:20px!important;height:20px!important}.gh-icon-btn svg{width:20px!important;height:20px!important}.gh-icon-btn em{position:absolute;right:-3px;top:-4px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:#B94B43;color:#fff;font-size:8px;font-style:normal;font-weight:800;display:grid;place-items:center;border:2px solid #fff}.gh-user{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:11px!important;min-width:150px;text-align:left}.gh-user>span:nth-child(2){display:flex;flex-direction:column;min-width:0}.gh-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#173B3A;color:#F3D99D;font-size:10px;font-weight:800;flex:none;border:1px solid #DCCBA8}
.gh-welcome{display:flex;align-items:flex-end;justify-content:space-between;gap:30px;padding:25px 8px 20px}.gh-eyebrow{font-size:9px;letter-spacing:.18em;font-weight:800;color:#9A6B22;margin-bottom:8px}.gh-welcome h1{font-family:Georgia,'Times New Roman',serif;font-size:35px;line-height:1.08;font-weight:500;letter-spacing:-.03em;margin:0;color:#102344}.gh-welcome h1 span{font-family:var(--sans);font-size:25px}.gh-welcome h2{font-size:16px;margin:7px 0 2px;font-weight:700;color:#20395D}.gh-welcome p{margin:0;color:#758093;font-size:11px}.gh-verse{width:330px;text-align:center;font-family:Georgia,serif;font-size:13px;line-height:1.55;color:#243552;padding:5px 20px 0}.gh-verse small{display:block;font-family:var(--sans);font-size:9px;color:#707A8A;margin-top:7px}
.gh-kpis{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.gh-kpi{display:flex;align-items:center;gap:14px;min-width:0;min-height:112px;padding:18px 19px;border:1px solid #E5E1D8;border-radius:15px;background:#fffdf9;box-shadow:0 4px 18px rgba(31,48,45,.045);text-decoration:none;color:var(--gh-navy);box-sizing:border-box;transition:.16s ease}.gh-kpi:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(31,48,45,.08)}.gh-kpi-icon{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;flex:none}.gh-kpi-icon.blue{background:#EAF1FB;color:#2755A6}.gh-kpi-icon.green{background:#E6F2EB;color:#16865A}.gh-kpi-icon.gold{background:#F8EFD9;color:#B78935}.gh-kpi-icon.purple{background:#F0EAF9;color:#6B4CC2}.gh-kpi-icon .ico{background:transparent!important;box-shadow:none!important;width:25px!important;height:25px!important}.gh-kpi-icon svg{width:25px!important;height:25px!important}.gh-kpi>span:last-child{min-width:0;display:flex;flex-wrap:wrap;align-items:center;column-gap:8px}.gh-kpi small{display:block;width:100%;font-size:10px;color:#6C7686;font-weight:700}.gh-kpi strong{display:block;font-family:Georgia,'Times New Roman',serif;font-size:27px;line-height:1.1;color:#102344;margin-top:4px}.gh-kpi i{font-size:9px;font-style:normal;font-weight:800;margin-top:6px}.gh-kpi i.up{color:#16865A}.gh-kpi i.down{color:#A44B43}.gh-kpi i.flat{color:#788394}.gh-kpi em{display:block;width:100%;font-size:9px;color:#8992A0;font-style:normal;margin-top:4px}
.gh-grid{display:grid;gap:14px}.gh-main{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)!important;margin-bottom:14px}.gh-card{background:#fffdf9;border:1px solid #E5E1D8;border-radius:15px;padding:18px;box-shadow:0 4px 18px rgba(31,48,45,.045);min-width:0}.gh-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:13px}.gh-card-head>div:first-child{display:flex;gap:10px;align-items:center;min-width:0}.gh-card-head>div:first-child>div{min-width:0}.gh-mini-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none}.gh-mini-icon.blue{background:#EAF1FB;color:#2755A6}.gh-mini-icon.green{background:#E6F2EB;color:#16865A}.gh-mini-icon.gold{background:#F8EFD9;color:#B78935}.gh-mini-icon .ico{background:transparent!important;box-shadow:none!important;width:18px!important;height:18px!important}.gh-mini-icon svg{width:18px!important;height:18px!important}.gh-card-head h3{margin:0;font-size:13px;line-height:1.2;color:#102344}.gh-card-head p{margin:4px 0 0;color:#7C8696;font-size:9px;line-height:1.35}.gh-select-link,.gh-link{font-size:9px;color:#A27429;text-decoration:none;white-space:nowrap;margin-top:5px}.gh-select-link:hover,.gh-link:hover{text-decoration:underline;color:#7D571C}
.gh-chart{height:250px;min-height:0;width:100%;overflow:hidden}.gh-chart svg{width:100%;height:100%;display:block;overflow:visible}.gh-grid-line{stroke:#EAE7E0;stroke-width:1}.gh-axis{fill:#8A93A1;font-family:var(--sans);font-size:9px}.gh-area{fill:rgba(47,110,87,.10)}.gh-line{stroke:#2F6E57;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.gh-point{fill:#fff;stroke:#2F6E57;stroke-width:3}.gh-point-hit{fill:transparent;stroke:transparent;cursor:pointer}.gh-chart-foot{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #EEEAE2;padding-top:10px;margin-top:3px;color:#7C8696;font-size:9px}.gh-chart-foot b{color:#102344;font-size:11px;margin-right:3px}.gh-bars{height:250px;display:flex;align-items:flex-end;gap:10px;padding:6px 5px 0;border-bottom:1px solid #E7E3DB}.gh-bar-item{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px}.gh-bar-value{font-size:8px;color:#6D7788;min-height:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.gh-bar-track{width:min(44px,100%);height:172px;display:flex;align-items:flex-end;background:linear-gradient(to top,transparent 0,transparent 24.5%,#EEF0EB 25%,transparent 25.5%,transparent 49.5%,#EEF0EB 50%,transparent 50.5%,transparent 74.5%,#EEF0EB 75%,transparent 75.5%);border-radius:8px 8px 0 0;overflow:hidden}.gh-bar-track i{display:block;width:100%;background:linear-gradient(180deg,#D4AC5B,#B78935);border-radius:7px 7px 0 0;box-shadow:0 5px 12px rgba(154,107,34,.12)}.gh-bar-label{font-size:9px;color:#758096;margin-bottom:3px}.gh-chart-empty{min-height:190px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:#7F8998;font-size:10px;text-align:center}.gh-chart-empty strong{color:#30405A;font-size:12px}.gh-chart-empty a{color:#A27429;text-decoration:none;margin-top:4px}
.gh-lower{grid-template-columns:minmax(0,1.1fr) minmax(0,1.1fr) minmax(260px,.72fr)!important;margin-bottom:14px}.gh-event-list,.gh-activity-list,.gh-attention-list,.gh-birthday-list{display:flex;flex-direction:column}.gh-event{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #ECE9E2;text-decoration:none;color:var(--gh-navy);min-width:0}.gh-event:last-child,.gh-activity:last-child{border-bottom:0}.gh-date{width:43px;height:48px;border-radius:9px;background:#FBF0EF;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;color:#A52323}.gh-date b{font-size:8px}.gh-date strong{font-size:17px;line-height:1}.gh-event>span:nth-child(2){min-width:0;flex:1}.gh-event strong{display:block;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gh-event small{display:flex;align-items:center;gap:3px;color:#6F798B;font-size:8px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gh-inline-icon{background:transparent!important;box-shadow:none!important;width:11px!important;height:11px!important;flex:none}.gh-inline-icon svg{width:11px!important;height:11px!important}.gh-event em{font-size:8px;font-style:normal;background:#EAF7EF;color:#16865A;border-radius:999px;padding:4px 7px;flex:none}.gh-activity{display:flex;gap:9px;align-items:flex-start;padding:10px 0;border-bottom:1px solid #ECE9E2;min-width:0}.gh-activity-icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#F3F0E7;color:#A27429;flex:none}.gh-activity-icon .ico{background:transparent!important;box-shadow:none!important;width:16px!important;height:16px!important}.gh-activity-icon svg{width:16px!important;height:16px!important}.gh-activity>span:last-child{min-width:0}.gh-activity strong{display:block;font-size:9px;line-height:1.35;white-space:normal;overflow-wrap:anywhere}.gh-activity small{display:block;color:#758096;font-size:8px;margin-top:3px}
.gh-progress{display:flex;align-items:center;gap:12px;margin:4px 0 14px}.gh-progress>div{width:70px;height:70px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#16865A var(--pct),#E7ECE9 0);position:relative;flex:none}.gh-progress>div:after{content:'';position:absolute;inset:8px;background:#fff;border-radius:50%}.gh-progress>div span{position:relative;z-index:1;font-size:11px;font-weight:800}.gh-progress section{min-width:0}.gh-progress section strong{font-size:11px}.gh-progress section p{font-size:8px;color:#758096;line-height:1.45;margin:4px 0 0}.gh-setup ul{list-style:none;margin:0 0 13px;padding:0}.gh-setup li{font-size:8px;padding:5px 0;display:flex;gap:7px;align-items:center;color:#4E5B70}.gh-setup li span{width:15px;height:15px;border-radius:50%;border:1px solid #BFC6D0;display:grid;place-items:center;font-size:8px;flex:none}.gh-setup li.done span{background:#16865A;border-color:#16865A;color:#fff}.gh-gold-btn{display:block;text-align:center;background:linear-gradient(135deg,#C69A40,#B17C2A);color:#fff;border-radius:8px;padding:9px;text-decoration:none;font-size:9px;font-weight:700}.gh-insight-row{grid-template-columns:minmax(0,1.1fr) minmax(0,1.1fr) minmax(260px,.72fr)!important;margin-bottom:14px}.gh-attention-item{display:flex;align-items:center;gap:9px;padding:9px 0;border-bottom:1px solid #ECE9E2;text-decoration:none;color:#102344}.gh-attention-item:last-child{border-bottom:0}.gh-attention-item>span{width:7px;height:7px;border-radius:50%;background:#B78935;box-shadow:0 0 0 4px rgba(183,137,53,.10);flex:none}.gh-attention-item div{min-width:0;flex:1}.gh-attention-item strong{display:block;font-size:9px;overflow-wrap:anywhere}.gh-attention-item small{display:block;color:#7C8696;font-size:8px;margin-top:2px}.gh-attention-item>b{font-size:12px;color:#A27429}.gh-empty.gh-good{min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}.gh-good>span{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#E6F2EB;color:#16865A;font-weight:800}.gh-good strong{font-size:11px}.gh-good small{font-size:8px;color:#7C8696}.gh-journey-mini{display:flex;flex-direction:column;gap:11px;padding:4px 0}.gh-journey-mini>a{display:grid;grid-template-columns:125px minmax(0,1fr);align-items:center;gap:10px;text-decoration:none;color:#102344}.gh-journey-mini>a>span{display:flex;align-items:baseline;gap:6px;min-width:0}.gh-journey-mini b{font-family:Georgia,serif;font-size:17px}.gh-journey-mini small{font-size:8px;color:#758096;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gh-journey-mini i{height:7px;border-radius:999px;background:#ECE9E2;overflow:hidden}.gh-journey-mini em{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2F6E57,#C99A4A)}.gh-birthday-list>a{display:flex;align-items:center;gap:9px;padding:8px 0;border-bottom:1px solid #ECE9E2;text-decoration:none;color:#102344}.gh-birthday-list>a:last-child{border-bottom:0}.gh-bday-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#F5EFE1;color:#A27429;font-size:10px;font-weight:800;flex:none}.gh-birthday-list strong{display:block;font-size:9px}.gh-birthday-list small{display:block;color:#7C8696;font-size:8px;margin-top:2px}.gh-quick{margin-bottom:14px}.gh-actions-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.gh-action{display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:12px;border:1px solid #E7E2D9;border-radius:11px;background:#FFFEFB;text-decoration:none;color:#102344;transition:.15s ease}.gh-action:hover{border-color:#D4C8AF;background:#FBF7EF;transform:translateY(-1px)}.gh-action>span{width:30px;height:30px;border-radius:9px;background:#F5EFE1;color:#A27429;display:grid;place-items:center;margin-bottom:8px}.gh-action>span .ico{background:transparent!important;box-shadow:none!important;width:17px!important;height:17px!important}.gh-action>span svg{width:17px!important;height:17px!important}.gh-action strong{font-size:9px}.gh-action small{font-size:8px;color:#7C8696;margin-top:3px;line-height:1.35}.gh-promo{min-height:190px;margin-top:0;border-radius:15px;overflow:hidden;background-image:linear-gradient(90deg,rgba(12,29,47,.90),rgba(12,29,47,.38)),url('../assets/gracehub-promo.jpg');background-size:cover;background-position:center;display:flex;align-items:center;padding:26px 32px;box-shadow:var(--shadow-1);box-sizing:border-box}.gh-promo-copy{max-width:390px;color:#fff}.gh-promo-copy>span{font-size:8px;letter-spacing:.22em}.gh-promo-copy h3{font-family:Georgia,serif;font-size:25px;line-height:1.05;margin:7px 0 8px}.gh-promo-copy p{font-size:9px;line-height:1.5;color:rgba(255,255,255,.84);margin:0 0 14px}.gh-promo-copy a{display:inline-block;background:#102344;color:#fff;padding:9px 14px;border-radius:7px;text-decoration:none;font-size:9px}.gh-footer{display:flex;justify-content:space-between;color:#7A8493;font-size:8px;padding:12px 4px 0}.gh-footer strong{color:#102344}.gh-footer span{margin-left:auto}
@media(max-width:1180px){.gh-lower,.gh-insight-row{grid-template-columns:1fr 1fr!important}.gh-setup,.gh-insight-row>.gh-card:last-child{grid-column:1/-1}.gh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}.gh-actions-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.gh-search{width:42%}}
@media(max-width:860px){.gh-dashboard{padding-bottom:20px}.gh-topbar{height:auto;min-height:60px;flex-wrap:wrap;padding:10px 12px;margin:0 -10px 4px!important}.gh-search{order:2;width:100%}.gh-top-actions{order:1;width:100%;justify-content:flex-end}.gh-church-switch{display:none}.gh-user{min-width:130px}.gh-welcome{padding:22px 4px 18px}.gh-welcome h1{font-size:29px}.gh-verse{display:none}.gh-main,.gh-lower,.gh-insight-row{grid-template-columns:1fr!important}.gh-setup,.gh-insight-row>.gh-card:last-child{grid-column:auto}.gh-kpis{grid-template-columns:1fr 1fr!important}.gh-actions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.gh-topbar{margin:0 -10px 2px!important}.gh-top-actions{gap:6px}.gh-icon-btn{width:38px;height:38px}.gh-user{min-width:0;padding:4px 6px}.gh-user span:nth-child(2){display:none}.gh-welcome h1{font-size:25px}.gh-welcome h2{font-size:15px}.gh-kpis{grid-template-columns:1fr!important}.gh-kpi{min-height:96px}.gh-card{padding:15px}.gh-card-head{gap:8px}.gh-card-head h3{font-size:12px}.gh-actions-grid{grid-template-columns:1fr 1fr}.gh-action{padding:10px}.gh-promo{min-height:200px;padding:22px}.gh-footer{display:block}.gh-footer span{display:block;margin:5px 0 0}}

/* ==========================================================================\n   GRACEHUB MODULE EXPERIENCE — v31\n   The dashboard is a special composition. Every other screen gets a proper\n   editorial page header, predictable content start, action area and contained\n   modules. This removes the old hidden-header / content-under-the-line problem.\n   ========================================================================== */

/* The application page header is part of the product chrome on every module. */
body:not([data-route="dashboard"]) header.page {
  display:flex!important;
  position:sticky;
  top:0;
  z-index:60;
  min-height:78px;
  padding:18px 28px 16px!important;
  align-items:center;
  background:rgba(255,255,255,.96)!important;
  border-bottom:1px solid var(--gh-line)!important;
  box-shadow:0 1px 0 rgba(16,35,68,.02);
  backdrop-filter:none;
}
body:not([data-route="dashboard"]) header.page #page-title {
  min-width:0;
  flex:1 1 auto;
  align-items:center;
}
body:not([data-route="dashboard"]) header.page #page-title > div { min-width:0; }
body:not([data-route="dashboard"]) header.page h1 {
  color:var(--gh-navy)!important;
  font-family:var(--sans)!important;
  font-size:25px!important;
  line-height:1.15!important;
  font-weight:700!important;
  margin:0!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body:not([data-route="dashboard"]) header.page .sub {
  color:#788398!important;
  font-size:12px!important;
  line-height:1.4;
  margin-top:4px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body:not([data-route="dashboard"]) header.page .actions {
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:0 0 auto;
}
body:not([data-route="dashboard"]) header.page .actions button,
body:not([data-route="dashboard"]) header.page .actions .btn {
  min-height:38px;
  padding:8px 14px;
  border-radius:9px;
  font-size:12px;
  font-weight:700;
  box-shadow:none;
}
body:not([data-route="dashboard"]) header.page .actions button.primary { box-shadow:0 5px 14px rgba(183,137,53,.16); }

/* Give every module a clean breathing area below the page chrome. */
body:not([data-route="dashboard"]) #view {
  padding:24px 28px 72px!important;
  width:100%;
  max-width:1500px;
  margin:0 auto;
  min-width:0;
}
body:not([data-route="dashboard"]) #view > * { min-width:0; }

/* CRM screens already had an internal hero. The shell header replaces that\n   duplicate title so the module opens immediately into its useful content. */
body[data-route="journey"] .os-hero,
body[data-route="tasks"] .os-hero,
body[data-route="segments"] .os-hero,
body[data-route="activity"] .os-hero { display:none!important; }

/* Consistent page intro surfaces when a module supplies its own section head. */
#view .toolbar {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  min-width:0;
}
#view .toolbar > * { flex:0 1 auto; min-width:140px; width:auto; }
#view .toolbar > .spacer { min-width:0; }

/* Tables never escape their cards or force the page wider than the viewport. */
#view .card { min-width:0; overflow:hidden; }
#view .table-wrap { max-width:100%; min-width:0; overflow-x:auto; }
#view table { min-width:640px; }
#view .card > .table-wrap table { width:100%; }
#view td, #view th { overflow-wrap:break-word; }
#view td .row { min-width:0; }

/* Forms stay inside their columns instead of creating accidental horizontal\n   overflow when a label, select or long email address is present. */
#view form, #view .grid, #view .row { min-width:0; max-width:100%; }
#view label.field { min-width:0; }
#view label.field > span { white-space:normal; overflow-wrap:anywhere; }
#view input, #view select, #view textarea { max-width:100%; min-width:0; }

/* Equal visual rhythm for common KPI/stat cards without forcing every card to\n   have the same height as a report or form. */
#view .grid.g4,
#view .grid.g3,
#view .grid.g2 { align-items:stretch; }
#view .grid.g4 > .stat,
#view .grid.g3 > .stat,
#view .grid.g2 > .stat { height:100%; }
#view .stat { display:flex; flex-direction:column; justify-content:flex-start; min-width:0; }
#view .stat .label { min-height:18px; }

/* GraceHub tabs: one quiet navigation line, not a collection of floating\n   rectangles. */
#view .tabs {
  display:flex;
  gap:4px;
  align-items:flex-end;
  overflow-x:auto;
  border-bottom:1px solid var(--gh-line);
  margin:18px 0 16px;
  padding:0 2px;
  scrollbar-width:none;
}
#view .tabs::-webkit-scrollbar { display:none; }
#view .tabs button {
  flex:0 0 auto;
  min-height:40px;
  border:0!important;
  border-bottom:2px solid transparent!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#788398!important;
  padding:8px 13px!important;
  font-size:12px;
  font-weight:700;
}
#view .tabs button:hover { background:#F8F5EE!important; color:var(--gh-navy)!important; }
#view .tabs button.active { color:var(--gh-navy)!important; border-bottom-color:var(--gh-gold)!important; }

/* Small action rows inside cards. */
#view .row-actions { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
#view .row-actions button, #view .row-actions .btn { min-height:36px; }

/* Section headings in existing modules. */
#view .card > h2:first-child {
  color:var(--gh-navy);
  font-size:18px;
  font-weight:750;
}
#view .card > h3:first-child {
  color:#59657A;
  font-size:11px;
  letter-spacing:.09em;
}

/* Better empty states: calm, centered and never cramped. */
#view .empty,
#view .empty-state { min-width:0; }
#view .card > .empty { padding:28px 14px; }

/* Admin/account footer is a true fixed-height section of the sidebar. */
#sidebar { overflow:hidden!important; }
#sidebar #nav { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; }
#account-footer {
  flex:0 0 auto!important;
  position:relative!important;
  z-index:5;
  background:#fff!important;
  border-top:1px solid var(--gh-line)!important;
  padding:12px 12px calc(13px + env(safe-area-inset-bottom))!important;
}
.account-name { max-width:100%; }
.account-actions { grid-template-columns:repeat(3,minmax(0,1fr))!important; }
.account-action { min-width:0!important; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Icons: one GraceHub family throughout the application. */
.ico { color:var(--gh-navy); }
.ico svg { stroke:currentColor!important; }
button .ico, .btn .ico { box-shadow:none!important; background:transparent!important; }

/* Report/chart containers receive deliberate proportions. */
#view .chart,
#view .gh-chart { min-width:0; max-width:100%; }
#view .chart { min-height:150px; align-items:flex-end; }
#view .chart .col { min-width:36px; }
#view .chart .cap { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
#view .report-head { margin-bottom:16px; }
#view .report-head + .toolbar { margin-bottom:16px; }

/* Prevent long content in cards from colliding with neighboring cards. */
#view .card p,
#view .card small,
#view .card .muted,
#view .card .sub { overflow-wrap:anywhere; }
#view .segment-card,
#view .journey-stage,
#view .person360-grid > .card { min-width:0; }

/* A consistent mobile page header. */
@media (max-width:860px) {
  body:not([data-route="dashboard"]) header.page {
    padding:14px 18px 13px!important;
    min-height:70px;
  }
  body:not([data-route="dashboard"]) header.page h1 { font-size:21px!important; }
  body:not([data-route="dashboard"]) header.page .sub { font-size:11px!important; }
  body:not([data-route="dashboard"]) header.page .actions { width:auto; }
  body:not([data-route="dashboard"]) header.page .actions button,
  body:not([data-route="dashboard"]) header.page .actions .btn { padding:8px 11px; }
  body:not([data-route="dashboard"]) #view { padding:18px 18px 60px!important; }
}
@media (max-width:560px) {
  body:not([data-route="dashboard"]) header.page {
    align-items:flex-start;
    flex-wrap:wrap;
    gap:10px;
  }
  body:not([data-route="dashboard"]) header.page #page-title { flex:1 1 100%; }
  body:not([data-route="dashboard"]) header.page .actions { width:100%; justify-content:flex-start; }
  body:not([data-route="dashboard"]) header.page .actions button,
  body:not([data-route="dashboard"]) header.page .actions .btn { flex:0 1 auto; }
  body:not([data-route="dashboard"]) #view { padding:14px 12px 52px!important; }
  #view table { min-width:560px; }
  #view .toolbar > * { min-width:0; flex:1 1 140px; }
}

/* Print only the useful module content, not the application chrome. */
@media print {
  body:not([data-route="dashboard"]) header.page { display:none!important; }
  body:not([data-route="dashboard"]) #view { padding:0!important; max-width:none; }
}

/* ======================================================================
   GRACEHUB FINAL POLISH — v32
   Dashboard and administration are first-class GraceHub experiences.
   ====================================================================== */
#sidebar{background:#fff!important;color:var(--gh-navy)!important}
#sidebar .brand{background:#fff!important}
#nav{background:#fff!important}
#account-footer{background:#fff!important;color:var(--gh-navy)!important}
#account-footer .account-name{color:var(--gh-navy)!important;font-weight:700}
#account-footer .account-role{color:#788398!important}
.account-action{background:#F7F4EC!important;color:var(--gh-navy)!important;border:1px solid #E6E0D5!important;border-radius:8px!important}
.account-action:hover{background:#EEE7D8!important;border-color:#D7C8A9!important}
.account-action.danger{color:#9B4D45!important}

/* Dashboard matches the supplied GraceHub composition in the first viewport. */
.gh-dashboard{max-width:100%;overflow:hidden}
.gh-topbar{margin:0 -18px!important;padding:0 26px!important}
.gh-welcome{background-position:right center!important;min-height:144px!important}
.gh-welcome h1{font-size:38px!important;line-height:1.05!important;color:var(--gh-navy)!important}
.gh-welcome h2{font-size:23px!important;margin-top:7px!important}
.gh-welcome p{font-size:13px!important}
.gh-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important}
.gh-kpi{min-height:126px!important;padding:20px!important;border-radius:13px!important}
.gh-kpi strong{font-size:28px!important}
.gh-main{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)!important;gap:14px!important}
.gh-lower{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(250px,.68fr)!important;gap:14px!important}
.gh-card{border-radius:13px!important}
.gh-chart-card{min-height:265px}
.gh-chart{height:150px!important}
.gh-line-chart svg{height:150px!important}
.gh-bars{height:154px!important}
.gh-bar-track{height:118px!important}
.gh-setup{min-height:315px}
.gh-promo{min-height:268px!important;background-position:center!important}
.gh-footer{padding:15px 4px!important}
@media(max-width:1180px){.gh-main,.gh-lower{grid-template-columns:1fr 1fr!important}.gh-setup{grid-column:1/-1}.gh-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:860px){.gh-main,.gh-lower{grid-template-columns:1fr!important}.gh-setup{grid-column:auto}.gh-kpis{grid-template-columns:1fr 1fr!important}.gh-welcome h1{font-size:30px!important}}
@media(max-width:560px){.gh-kpis{grid-template-columns:1fr!important}.gh-welcome h1{font-size:26px!important}}

/* Admin workspace cards. */
.feature-access-card{min-height:118px;display:flex;align-items:center}
.status.good{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;background:#E7F3EB;color:#16865A;font-size:10px;font-weight:800}

/* ======================================================================
   GraceHub v33 — dashboard + administrator routing correction
   ====================================================================== */
.gh-chart-empty-frame{width:100%;box-sizing:border-box;min-height:150px!important;border:0!important;background:transparent!important;box-shadow:none!important;}
.gh-chart-empty-frame .gh-chart-empty{min-height:150px!important;width:100%;}
body[data-route="users"] #view,body[data-route="audit"] #view,body[data-route="subscription"] #view,body[data-route="usage"] #view,body[data-route="features"] #view,body[data-route="settings"] #view,body[data-route="backup"] #view{min-width:0;}
#view .table-wrap{max-width:100%;overflow-x:auto;}
#view table{min-width:0;}

/* ========================================================================
   GRACEHUB v34 — spacing, chart geometry, reports and account management
   ======================================================================== */

/* Keep the dashboard charts from being vertically compressed or stretched. */
.gh-chart { width:100%; aspect-ratio: 760 / 300; min-height:220px; overflow:hidden; }
.gh-chart svg { display:block; width:100%; height:100%; }
.gh-line-chart { padding:8px 4px 2px; box-sizing:border-box; }
.gh-line-chart .gh-grid-line { stroke:#E7E4DD; stroke-width:1; }
.gh-line-chart .gh-axis { fill:#788398; font-size:11px; }
.gh-line-chart .gh-line { stroke:#2E6B58; stroke-width:3.5; stroke-linecap:round; stroke-linejoin:round; }
.gh-line-chart .gh-area { fill:rgba(46,107,88,.10); }
.gh-line-chart .gh-point { fill:#fff; stroke:#2E6B58; stroke-width:3; }
.gh-chart-card { min-width:0; }
.gh-chart-foot { min-height:38px; }

/* Reports: spacious, non-compressed visual reporting area. */
.report-visual-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:18px; margin:18px 0; }
.report-chart-card { min-width:0; overflow:hidden; padding:22px 22px 18px; }
.report-chart-card:nth-child(3) { grid-column:1 / -1; }
.report-chart-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:10px; min-width:0; }
.report-chart-head > div { min-width:0; }
.report-eyebrow { display:block; color:#B78935; font-size:10px; font-weight:800; letter-spacing:.16em; margin-bottom:4px; }
.report-chart-head h3 { margin:0; color:#102344; font-size:17px; line-height:1.25; }
.report-chart-head p { margin:5px 0 0; color:#788398; font-size:12px; line-height:1.45; }
.report-chart-total { flex:none; color:#102344; font-family:Georgia,serif; font-size:20px; font-weight:700; white-space:nowrap; }
.report-chart { width:100%; aspect-ratio:900 / 320; min-height:250px; overflow:hidden; }
.report-chart svg { display:block; width:100%; height:100%; }
.report-grid { stroke:#E7E4DD; stroke-width:1; }
.report-axis { fill:#788398; font-size:12px; }
.report-area { fill:rgba(46,107,88,.09); }
.report-line { fill:none; stroke:#2E6B58; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.report-point { fill:#fff; stroke:#2E6B58; stroke-width:3; }
.report-chart-empty { min-height:240px; display:grid; place-items:center; color:#8A93A1; font-size:13px; background:#FBFAF7; border:1px dashed #DDD8CC; border-radius:10px; }
.report-bar-chart { height:280px; display:flex; align-items:stretch; gap:14px; padding:12px 4px 0; overflow:hidden; }
.report-bar-col { flex:1 1 0; min-width:42px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:7px; }
.report-bar-value { color:#102344; font-size:11px; font-weight:700; white-space:nowrap; min-height:16px; }
.report-bar-track { width:100%; max-width:54px; height:205px; display:flex; align-items:flex-end; background:#F0EDE6; border-radius:9px 9px 4px 4px; overflow:hidden; }
.report-bar-track i { display:block; width:100%; min-height:2px; background:linear-gradient(180deg,#C99A4A,#A97A2D); border-radius:9px 9px 3px 3px; }
.report-bar-label { color:#788398; font-size:11px; white-space:nowrap; }
.report-pie-wrap { display:grid; grid-template-columns:minmax(240px,1fr) minmax(210px,.8fr); gap:22px; align-items:center; min-height:300px; }
.report-pie { width:min(320px,100%); aspect-ratio:1; margin:auto; }
.report-pie svg { display:block; width:100%; height:100%; }
.report-pie-slice { stroke:#fff; stroke-width:2; }
.report-pie-slice.pie-0 { fill:#2E6B58; }.report-pie-slice.pie-1 { fill:#C99A4A; }.report-pie-slice.pie-2 { fill:#7487A1; }.report-pie-slice.pie-3 { fill:#B86E4B; }.report-pie-slice.pie-4 { fill:#8B7A9F; }.report-pie-slice.pie-5 { fill:#6F8C83; }
.report-pie-hole { fill:#fff; }
.report-pie-total { fill:#102344; font-family:Georgia,serif; font-size:24px; font-weight:700; }
.report-pie-caption { fill:#788398; font-size:10px; letter-spacing:.12em; }
.report-legend { display:flex; flex-direction:column; gap:10px; }
.report-legend-item { display:grid; grid-template-columns:12px minmax(0,1fr) auto; align-items:center; gap:9px; color:#40506A; font-size:12px; }
.report-legend-item strong { color:#102344; }
.report-swatch { width:10px; height:10px; border-radius:3px; }
.report-swatch.pie-0{background:#2E6B58}.report-swatch.pie-1{background:#C99A4A}.report-swatch.pie-2{background:#7487A1}.report-swatch.pie-3{background:#B86E4B}.report-swatch.pie-4{background:#8B7A9F}.report-swatch.pie-5{background:#6F8C83}

/* User management: make security controls explicit inside Manage. */
.user-security-section { margin-top:18px; padding:16px; border:1px solid #E4DED1; border-radius:12px; background:#FBFAF7; }
.user-security-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; margin-bottom:12px; }
.user-security-head h3 { margin:0; color:#102344; font-size:15px; }
.security-status { flex:none; padding:5px 9px; border-radius:999px; font-size:10px; font-weight:800; white-space:nowrap; }
.security-status.on { color:#176B4B; background:#E5F2EB; }.security-status.off { color:#7C6B4B; background:#F4EEE1; }

/* Sidebar account footer now contains sign-out only; password/2-step live under Users & access. */
.account-actions { justify-content:flex-start; }

@media(max-width:1000px){
  .report-visual-grid{grid-template-columns:1fr}.report-chart-card:nth-child(3){grid-column:auto}
  .report-pie-wrap{grid-template-columns:1fr}.report-pie{max-width:300px}
}
@media(max-width:650px){
  .report-chart-card{padding:17px}.report-chart{min-height:210px}.report-bar-chart{height:235px;gap:7px}.report-bar-track{height:165px}.report-bar-value{font-size:9px}.report-bar-label{font-size:9px}.report-chart-head h3{font-size:15px}.report-chart-head p{font-size:11px}.report-chart-total{font-size:16px}.user-security-head{display:block}.security-status{display:inline-block;margin-top:9px}
}


/* ==========================================================================
   GRACEHUB DEEP MODULE UX PASS — v35
   The dashboard has its own editorial composition. Every other screen now
   gets a more spacious, deliberate workspace: larger type, stable geometry,
   consistent toolbars, readable tables, generous cards and contained charts.
   ========================================================================== */

:root{
  --gh-navy:#102344;
  --gh-navy-2:#1B3155;
  --gh-forest:#245B4E;
  --gh-forest-2:#2F6E57;
  --gh-gold:#C5963B;
  --gh-gold-2:#B78332;
  --gh-cream:#F7F3EA;
  --gh-paper:#FFFDF9;
  --gh-line:#E4DED2;
  --gh-muted:#778298;
  --gh-shadow:0 8px 26px rgba(16,35,68,.07);
}

/* --- Global module canvas ------------------------------------------------ */
body:not([data-route="dashboard"]) #main{
  background:linear-gradient(180deg,#FBF9F4 0%,#F6F2E9 100%);
}
body:not([data-route="dashboard"]) #view{
  width:100%;
  max-width:1480px;
  margin:0 auto;
  padding:28px 34px 44px!important;
  font-size:14px;
  line-height:1.5;
}
body:not([data-route="dashboard"]) #view > *{
  max-width:100%;
}
body:not([data-route="dashboard"]) #view > .grid,
body:not([data-route="dashboard"]) #view > .report-visual-grid{
  width:100%;
}

/* --- Page headers --------------------------------------------------------- */
body:not([data-route="dashboard"]) header.page{
  min-height:86px;
  padding:18px 34px;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--gh-line);
}
body:not([data-route="dashboard"]) header.page h1,
body:not([data-route="dashboard"]) header.page #page-title h1{
  color:var(--gh-navy);
  font-size:30px;
  line-height:1.12;
  font-weight:700;
  letter-spacing:-.025em;
}
body:not([data-route="dashboard"]) header.page .sub{
  margin-top:6px;
  font-size:14px;
  color:#748096;
}
body:not([data-route="dashboard"]) header.page .actions{
  gap:9px;
}
body:not([data-route="dashboard"]) header.page .actions button{
  min-height:42px;
  padding:0 17px;
  border-radius:9px;
  font-size:13px;
  font-weight:700;
}
body:not([data-route="dashboard"]) header.page .actions button.primary{
  background:var(--gh-gold);
  border-color:var(--gh-gold);
  color:#fff;
}

/* --- Editorial internal heroes ------------------------------------------ */
#view .os-hero{
  margin:0 0 22px;
  padding:22px 24px;
  min-height:116px;
  border:1px solid var(--gh-line);
  border-radius:16px;
  background:linear-gradient(135deg,#FFFDF9 0%,#F3EEE4 100%);
  box-shadow:var(--gh-shadow);
}
#view .os-hero h2{
  margin:4px 0 6px;
  color:var(--gh-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:27px;
  line-height:1.15;
}
#view .os-hero p{
  max-width:760px;
  margin:0;
  color:#6F7B8D;
  font-size:14px;
}
#view .eyebrow,
#view .os-hero .eyebrow{
  color:#A27429;
  font-size:11px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

/* --- Cards: stable geometry and better hierarchy ------------------------ */
#view .card,
#view .erp-card{
  background:rgba(255,255,255,.96);
  border:1px solid var(--gh-line);
  border-radius:14px;
  box-shadow:var(--gh-shadow);
  overflow:hidden;
}
#view .card{
  padding:20px;
}
#view .card > h2,
#view .card > h3{
  color:var(--gh-navy);
  margin:0 0 8px;
  font-size:18px;
  line-height:1.25;
}
#view .card > p{
  color:#758096;
  font-size:13px;
}
#view .stat{
  min-height:118px;
  justify-content:center;
}
#view .stat b{
  color:var(--gh-navy);
  font-size:30px;
  line-height:1;
}
#view .stat span{
  color:#738096;
  font-size:12px;
  margin-top:8px;
}
#view .grid{
  gap:18px;
}

/* --- Toolbars / filters -------------------------------------------------- */
#view .toolbar,
#view .filters,
#view .filterbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:10px 12px!important;
  margin:0 0 18px!important;
  border:1px solid var(--gh-line)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(16,35,68,.05)!important;
}
#view .toolbar input,
#view .toolbar select,
#view .toolbar button,
#view .filters input,
#view .filters select,
#view .filters button,
#view .filterbar input,
#view .filterbar select,
#view .filterbar button{
  min-height:38px;
  font-size:13px;
}
#view .toolbar input,
#view .toolbar select,
#view .filters input,
#view .filters select,
#view .filterbar input,
#view .filterbar select{
  border:1px solid #D7D1C6;
  border-radius:8px;
  background:#FFFDF9;
  padding:0 11px;
}
#view .toolbar button,
#view .filters button,
#view .filterbar button{
  border-radius:8px;
  padding:0 13px;
  font-weight:700;
}

/* --- Tables -------------------------------------------------------------- */
#view .table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid var(--gh-line);
  border-radius:12px;
  background:#fff;
}
#view table{
  width:100%;
  min-width:680px;
  border-collapse:separate!important;
  border-spacing:0;
  font-size:13px;
}
#view table thead th{
  height:44px;
  padding:0 13px!important;
  background:#F5F1E8!important;
  color:#657084!important;
  border-bottom:1px solid var(--gh-line)!important;
  font-size:10px!important;
  font-weight:800!important;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}
#view table tbody td{
  min-height:48px;
  padding:12px 13px!important;
  color:#33415A;
  border-bottom:1px solid #EEEAE2!important;
  vertical-align:middle;
}
#view table tbody tr:last-child td{
  border-bottom:0!important;
}
#view table tbody tr:hover td{
  background:#FCFAF6!important;
}
#view table td a{
  color:var(--gh-navy);
  font-weight:650;
  text-decoration:none;
}
#view table td a:hover{
  color:#9B6D24;
  text-decoration:underline;
}

/* --- Buttons / actions --------------------------------------------------- */
#view .btn,
#view button{
  font-family:inherit;
}
#view button.primary,
#view .btn.primary{
  background:var(--gh-gold);
  border-color:var(--gh-gold);
  color:#fff;
  box-shadow:0 5px 14px rgba(183,137,53,.15);
}
#view button.primary:hover,
#view .btn.primary:hover{
  background:#A97825;
  border-color:#A97825;
}
#view button:not(.primary){
  color:var(--gh-navy);
}
#view .link,
#view a.link{
  color:#8E682D;
}

/* --- Forms --------------------------------------------------------------- */
#view label{
  color:#59667B;
  font-size:12px;
  font-weight:750;
  margin-bottom:5px;
}
#view input,
#view select,
#view textarea{
  max-width:100%;
  box-sizing:border-box;
}
#view input:focus,
#view select:focus,
#view textarea:focus{
  border-color:#C5963B!important;
  box-shadow:0 0 0 3px rgba(197,150,59,.13)!important;
  outline:none;
}
#view textarea{
  min-height:110px;
  resize:vertical;
}

/* --- Status / badges ----------------------------------------------------- */
#view .status-badge{
  display:inline-flex;
  align-items:center;
  min-height:27px;
  padding:0 9px;
  border:1px solid #E0D8C9;
  border-radius:999px;
  background:#F8F4EC;
  color:#5B6677;
  font-size:11px;
  font-weight:750;
  white-space:nowrap;
}
#view .badge,
#view .pill{
  border-radius:999px;
}

/* --- CRM funnel / journey ----------------------------------------------- */
#view .journey-funnel{
  display:grid;
  grid-template-columns:repeat(9,minmax(90px,1fr));
  gap:8px;
  margin:0 0 20px;
}
#view .journey-stage{
  min-height:92px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:7px;
  padding:10px;
  border:1px solid var(--gh-line);
  border-radius:12px;
  background:#fff;
  color:#667287;
  text-align:center;
  font-size:11px;
}
#view .journey-count{
  color:var(--gh-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:25px;
  font-weight:700;
}
@media(max-width:1250px){
  #view .journey-funnel{grid-template-columns:repeat(5,minmax(110px,1fr));}
}
@media(max-width:760px){
  #view .journey-funnel{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* --- People / CRM list density ------------------------------------------ */
#view .people-grid,
#view .person-grid,
#view .crm-grid{
  gap:18px;
}
#view .person-card,
#view .people-card,
#view .crm-card{
  border:1px solid var(--gh-line);
  border-radius:13px;
  background:#fff;
  box-shadow:0 5px 18px rgba(16,35,68,.05);
}

/* --- Dashboard chart proportions ---------------------------------------- */
.gh-chart-card{
  min-height:340px;
}
.gh-chart{
  width:100%;
  height:230px!important;
  min-height:230px!important;
  aspect-ratio:auto;
  overflow:hidden;
}
.gh-chart svg{
  width:100%;
  height:100%;
  display:block;
}
.gh-chart-foot{
  min-height:32px;
  align-items:center;
}
.gh-bar-track{
  height:170px!important;
}
.gh-bars{
  height:225px!important;
  padding-bottom:5px!important;
}

/* --- Reports: generous, non-compressed visual reporting ---------------- */
#view .report-visual-grid{
  display:grid!important;
  grid-template-columns:minmax(0,7fr) minmax(360px,5fr)!important;
  gap:20px!important;
  margin:0 0 22px!important;
}
#view .report-chart-card{
  min-width:0;
  min-height:380px;
  padding:22px!important;
}
#view .report-chart-card:nth-child(3){
  grid-column:1 / -1;
}
#view .report-chart-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  min-height:62px;
  margin-bottom:10px;
}
#view .report-chart-head h3{
  margin:3px 0 4px;
  color:var(--gh-navy);
  font-size:19px;
  line-height:1.25;
}
#view .report-chart-head p{
  margin:0;
  color:#7A8596;
  font-size:12px;
}
#view .report-eyebrow{
  color:#A27429;
  font-size:10px;
  font-weight:800;
  letter-spacing:.13em;
}
#view .report-chart-total{
  flex:0 0 auto;
  color:var(--gh-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:24px;
  font-weight:700;
}
#view .report-chart{
  width:100%;
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
}
#view .report-line-chart{
  height:270px;
}
#view .report-line-chart svg{
  width:100%;
  height:100%;
  display:block;
  overflow:visible;
}
#view .report-line-chart .report-line{
  stroke:var(--gh-forest-2);
  stroke-width:3.5;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#view .report-line-chart .report-area{
  fill:rgba(47,110,87,.10);
}
#view .report-line-chart .report-grid{
  stroke:#E9E5DC;
  stroke-width:1;
}
#view .report-line-chart .report-axis{
  fill:#7D8798;
  font-size:10px;
}
#view .report-line-chart .report-point{
  fill:#fff;
  stroke:var(--gh-forest-2);
  stroke-width:3;
}
#view .report-bar-chart{
  width:100%;
  height:270px;
  display:flex;
  align-items:flex-end;
  gap:14px;
  padding:12px 8px 0;
  border-bottom:1px solid #E7E2D8;
}
#view .report-bar-col{
  flex:1 1 0;
  min-width:34px;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
}
#view .report-bar-value{
  min-height:16px;
  color:#68758A;
  font-size:10px;
  font-weight:650;
  white-space:nowrap;
}
#view .report-bar-track{
  width:min(52px,78%);
  height:190px;
  display:flex;
  align-items:flex-end;
  border-radius:9px 9px 0 0;
  overflow:hidden;
  background:linear-gradient(to top,transparent 0,transparent 24.5%,#EEEAE1 25%,transparent 25.5%,transparent 49.5%,#EEEAE1 50%,transparent 50.5%,transparent 74.5%,#EEEAE1 75%,transparent 75.5%);
}
#view .report-bar-track i{
  display:block;
  width:100%;
  min-height:4px;
  border-radius:8px 8px 0 0;
  background:linear-gradient(180deg,#D3AA58,#B78332);
}
#view .report-bar-label{
  color:#707B8E;
  font-size:10px;
  white-space:nowrap;
}
#view .report-pie-wrap{
  width:100%;
  min-height:300px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:42px;
}
#view .report-pie{
  flex:0 0 300px;
  width:300px;
  height:300px;
}
#view .report-pie svg{
  width:100%;
  height:100%;
  display:block;
}
#view .report-pie-hole{
  fill:#FFFDF9;
}
#view .report-pie-total{
  fill:var(--gh-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:24px;
  font-weight:700;
}
#view .report-pie-caption{
  fill:#8992A0;
  font-size:9px;
  letter-spacing:.14em;
}
#view .report-legend{
  min-width:230px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
#view .report-legend-item{
  display:grid;
  grid-template-columns:12px 1fr auto;
  align-items:center;
  gap:8px;
  color:#536077;
  font-size:12px;
}
#view .report-legend-item strong{
  color:var(--gh-navy);
}
#view .report-swatch{
  width:10px;
  height:10px;
  border-radius:3px;
}
#view .report-chart-empty{
  width:100%;
  min-height:250px;
  display:grid;
  place-items:center;
  border:1px dashed #D9D2C5;
  border-radius:10px;
  color:#7B8697;
  background:#FCFAF6;
  font-size:13px;
}
@media(max-width:1050px){
  #view .report-visual-grid{grid-template-columns:1fr!important;}
  #view .report-chart-card:nth-child(3){grid-column:auto;}
}
@media(max-width:680px){
  body:not([data-route="dashboard"]) #view{padding:20px 14px 32px!important;}
  body:not([data-route="dashboard"]) header.page{padding:15px 18px;}
  body:not([data-route="dashboard"]) header.page h1{font-size:25px;}
  #view .report-pie-wrap{flex-direction:column;gap:20px;}
  #view .report-pie{flex-basis:260px;width:260px;height:260px;}
  #view .report-legend{width:100%;min-width:0;}
  #view .report-chart-card{min-height:350px;padding:16px!important;}
}

/* --- Calendar / event records ------------------------------------------- */
#view .calendar,
#view .calendar-grid{
  border:1px solid var(--gh-line);
  border-radius:13px;
  background:#fff;
  overflow:hidden;
}
#view .event-list,
#view .activity-list{
  display:flex;
  flex-direction:column;
  gap:0;
}
#view .event-list > *,
#view .activity-list > *{
  border-bottom:1px solid #EEEAE2;
}
#view .event-list > *:last-child,
#view .activity-list > *:last-child{
  border-bottom:0;
}

/* --- Finance ------------------------------------------------------------- */
body[data-route="giving"] #view .stat,
body[data-route="dues"] #view .stat,
body[data-route="projects"] #view .stat{
  border-top:3px solid var(--gh-gold);
}
body[data-route="giving"] #view .card h2,
body[data-route="dues"] #view .card h2,
body[data-route="projects"] #view .card h2{
  font-family:Georgia,"Times New Roman",serif;
}

/* --- Care / pastoral ----------------------------------------------------- */
body[data-route="care"] #view .card,
body[data-route="shepherding"] #view .card,
body[data-route="prayer"] #view .card,
body[data-route="baptisms"] #view .card,
body[data-route="dedications"] #view .card,
body[data-route="funerals"] #view .card,
body[data-route="weddings"] #view .card{
  border-top:3px solid #D8C29A;
}

/* --- Worship ------------------------------------------------------------- */
body[data-route="worship"] #view .card,
body[data-route="songs"] #view .card,
body[data-route="sermons"] #view .card,
body[data-route="announcements"] #view .card{
  border-top:3px solid var(--gh-forest-2);
}

/* --- Admin --------------------------------------------------------------- */
body[data-route="users"] #view .card,
body[data-route="audit"] #view .card,
body[data-route="subscription"] #view .card,
body[data-route="usage"] #view .card,
body[data-route="features"] #view .card,
body[data-route="settings"] #view .card,
body[data-route="backup"] #view .card{
  border-top:3px solid #C5963B;
}

/* --- Empty / error states ------------------------------------------------ */
#view .empty,
#view .empty-state{
  min-height:150px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:26px;
  text-align:center;
  color:#7D8797;
}
#view .banner{
  border-radius:10px;
}

/* --- Avoid accidental horizontal bleed --------------------------------- */
#view img,
#view svg,
#view canvas,
#view iframe{
  max-width:100%;
}
#view pre,
#view code{
  max-width:100%;
  overflow:auto;
}
#view .row > *,
#view [class*="col-"]{
  min-width:0;
}
#view h1,#view h2,#view h3,#view h4,#view h5,#view h6,
#view p,#view td,#view th,#view label,#view a,#view button{
  overflow-wrap:anywhere;
}

/* --- Print ---------------------------------------------------------------- */
@media print{
  body:not([data-route="dashboard"]) #view{
    max-width:none;
    padding:0!important;
    background:#fff!important;
  }
  #view .card,#view .report-chart-card{
    box-shadow:none!important;
    break-inside:avoid;
  }
}


/* ==========================================================================
   GRACEHUB MODULE UX PASS — v36
   ========================================================================== */

/* Page header: give module names enough visual weight to feel intentional. */
body:not([data-route="dashboard"]) header.page{
  min-height:92px!important;
  padding:20px 34px!important;
}
body:not([data-route="dashboard"]) header.page #page-title h1{
  font-size:31px!important;
  line-height:1.12!important;
  letter-spacing:-.028em!important;
}
body:not([data-route="dashboard"]) header.page #page-title .sub{
  font-size:13px!important;
  line-height:1.45!important;
}
body:not([data-route="dashboard"]) header.page .actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:9px;
}
body:not([data-route="dashboard"]) header.page .actions button{
  min-height:43px!important;
  font-size:13px!important;
  padding:0 16px!important;
}
.gh-action-icon{
  width:15px!important;
  height:15px!important;
  vertical-align:-3px;
  margin-right:5px;
}

/* Module content: a little more air, never cramped into the page edges. */
body:not([data-route="dashboard"]) #view{
  padding:30px 36px 50px!important;
}
body:not([data-route="dashboard"]) #view > .toolbar{
  margin-top:0!important;
}
#view .card{
  border-radius:15px!important;
}
#view .card h2,#view .card h3{
  letter-spacing:-.012em;
}
#view .card > h3{
  font-size:19px!important;
}
#view .small{
  line-height:1.45;
}

/* Make list screens feel like products, not raw database tables. */
#view .table-wrap{
  box-shadow:0 3px 12px rgba(16,35,68,.035);
}
#view table tbody td:first-child{
  font-weight:550;
}
#view table tbody tr{
  transition:background .12s ease;
}

/* Report visual section. */
#view .report-section-intro{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  margin:24px 0 12px;
}
#view .report-section-intro h2{
  margin:3px 0 5px;
  color:var(--gh-navy);
  font-family:Georgia,"Times New Roman",serif;
  font-size:28px;
  font-weight:500;
  letter-spacing:-.02em;
}
#view .report-section-intro p{
  margin:0;
  color:#748096;
  font-size:13px;
  max-width:700px;
}
#view .report-eyebrow{
  letter-spacing:.16em!important;
}
#view .report-chart-card{
  min-height:410px!important;
  padding:24px!important;
}
#view .report-chart-head h3{
  font-size:20px!important;
}
#view .report-chart-head p{
  font-size:13px!important;
}
#view .report-chart-total{
  font-size:27px!important;
}
#view .report-line-chart{
  height:285px!important;
  min-height:285px!important;
  margin-top:6px;
}
#view .report-line-chart svg{
  width:100%!important;
  height:100%!important;
}
#view .report-bar-chart{
  height:285px!important;
  padding-top:14px!important;
}
#view .report-bar-track{
  height:210px!important;
}
#view .report-pie-wrap{
  min-height:315px!important;
}
#view .report-pie{
  width:290px!important;
  height:290px!important;
  flex-basis:290px!important;
}
#view .report-legend-item{
  font-size:13px!important;
}
#view .report-legend-item strong{
  font-size:13px!important;
}

/* Dashboard: preserve the GraceHub reference composition but make the
   analytics cards breathe and keep the line chart geometrically stable. */
body[data-route="dashboard"] .gh-chart-card{
  min-height:375px!important;
}
body[data-route="dashboard"] .gh-chart{
  height:265px!important;
  min-height:265px!important;
}
body[data-route="dashboard"] .gh-chart svg{
  width:100%!important;
  height:100%!important;
}
body[data-route="dashboard"] .gh-card-head h3{
  font-size:15px!important;
}
body[data-route="dashboard"] .gh-card-head p{
  font-size:11px!important;
}
body[data-route="dashboard"] .gh-kpi{
  min-height:124px!important;
}
body[data-route="dashboard"] .gh-kpi strong{
  font-size:30px!important;
}
body[data-route="dashboard"] .gh-promo{
  min-height:280px!important;
  background-position:center!important;
}

/* Better form field hierarchy. */
#view input,#view select,#view textarea{
  min-height:41px;
  font-size:13px;
}
#view textarea{
  min-height:120px;
}
#view .form-grid,
#view .grid.g2,
#view .grid.g3,
#view .grid.g4{
  align-items:stretch;
}

/* Responsive module layout. */
@media(max-width:900px){
  body:not([data-route="dashboard"]) #view{
    padding:24px 20px 40px!important;
  }
  body:not([data-route="dashboard"]) header.page{
    padding:18px 22px!important;
  }
  body:not([data-route="dashboard"]) header.page #page-title h1{
    font-size:27px!important;
  }
  #view .report-section-intro{
    display:block;
  }
}
@media(max-width:620px){
  body:not([data-route="dashboard"]) #view{
    padding:18px 14px 32px!important;
  }
  body:not([data-route="dashboard"]) header.page{
    min-height:84px!important;
    padding:15px 16px!important;
  }
  body:not([data-route="dashboard"]) header.page #page-title h1{
    font-size:24px!important;
  }
  body:not([data-route="dashboard"]) header.page .actions{
    width:100%;
    margin-top:8px;
  }
  body:not([data-route="dashboard"]) header.page .actions button{
    flex:1 1 auto;
  }
  #view .report-chart-card{
    min-height:350px!important;
    padding:18px!important;
  }
  #view .report-line-chart,
  #view .report-bar-chart{
    height:245px!important;
    min-height:245px!important;
  }
  #view .report-bar-track{
    height:175px!important;
  }
  #view .report-pie-wrap{
    min-height:285px!important;
  }
  #view .report-pie{
    width:245px!important;
    height:245px!important;
    flex-basis:245px!important;
  }
}


/* ==========================================================================
   GRACEHUB DEEP MODULE UX — v37
   Purpose-built visual hierarchy for the major workspaces.
   ========================================================================== */

/* Common workspace framing */
body[data-route]:not([data-route="dashboard"]) #view{
  --workspace-gap:20px;
}
#view .workspace-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:0 0 20px;
}
#view .workspace-summary .ws-stat{
  min-height:104px;
  padding:17px 18px;
  border:1px solid #E5DFD4;
  border-radius:13px;
  background:#FFF;
  box-shadow:0 5px 18px rgba(16,35,68,.045);
}
#view .ws-stat small{
  display:block;
  color:#7A8596;
  font-size:10px;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  margin-bottom:9px;
}
#view .ws-stat strong{
  display:block;
  color:#102344;
  font-family:Georgia,"Times New Roman",serif;
  font-size:28px;
  line-height:1;
}
#view .ws-stat span{
  display:block;
  margin-top:7px;
  color:#7D8796;
  font-size:11px;
}

/* People / CRM */
body[data-route="people"] #view .toolbar,
body[data-route="households"] #view .toolbar,
body[data-route="visitors"] #view .toolbar,
body[data-route="journey"] #view .toolbar,
body[data-route="tasks"] #view .toolbar,
body[data-route="segments"] #view .toolbar{
  position:relative;
}
body[data-route="people"] #view .card:has(.table-wrap),
body[data-route="households"] #view .card:has(.table-wrap),
body[data-route="visitors"] #view .card:has(.table-wrap){
  padding:0!important;
}
body[data-route="people"] #view .card:has(.table-wrap) .table-wrap,
body[data-route="households"] #view .card:has(.table-wrap) .table-wrap,
body[data-route="visitors"] #view .card:has(.table-wrap) .table-wrap{
  border:0;
  box-shadow:none;
  border-radius:0;
}
body[data-route="people"] #view table th:first-child,
body[data-route="households"] #view table th:first-child,
body[data-route="visitors"] #view table th:first-child{
  padding-left:20px!important;
}
body[data-route="people"] #view table td:first-child,
body[data-route="households"] #view table td:first-child,
body[data-route="visitors"] #view table td:first-child{
  padding-left:20px!important;
}
body[data-route="people"] #view .tabs,
body[data-route="households"] #view .tabs,
body[data-route="visitors"] #view .tabs{
  margin-bottom:18px;
}
body[data-route="journey"] #view .journey-funnel{
  margin-top:4px;
}
body[data-route="journey"] #view .journey-stage{
  min-height:108px;
  background:linear-gradient(180deg,#FFF 0%,#FBF8F1 100%);
}
body[data-route="tasks"] #view .card,
body[data-route="segments"] #view .card{
  box-shadow:0 6px 20px rgba(16,35,68,.055);
}
body[data-route="tasks"] #view .card h3,
body[data-route="segments"] #view .card h3{
  font-size:19px!important;
}

/* Person 360 / detail */
#view .tabs{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  padding:5px;
  border:1px solid #E4DED2;
  border-radius:10px;
  background:#F7F3EA;
}
#view .tabs button{
  min-height:38px;
  padding:0 14px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#6D788B;
  font-weight:700;
}
#view .tabs button.active{
  background:#FFF;
  color:#102344;
  box-shadow:0 2px 8px rgba(16,35,68,.08);
}
#view .dl{
  margin:0;
}
#view .dl dt{
  color:#8A94A2;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
#view .dl dd{
  color:#263752;
  font-size:14px;
}

/* Attendance */
body[data-route="attendance"] #view .card:first-of-type{
  border-top:3px solid #2F6E57;
}
body[data-route="attendance"] #view .card h3{
  font-size:20px!important;
}
body[data-route="attendance"] #view .inline-check{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:7px 10px!important;
  border-bottom:1px solid #EEEAE2;
}
body[data-route="attendance"] #view .inline-check:last-child{
  border-bottom:0;
}
body[data-route="checkin"] #view #view{
  padding:0;
}
body[data-route="checkin"] #view .card{
  border-top:3px solid #2F6E57;
}
body[data-route="checkin"] #view .card:has(#checkin-roster),
body[data-route="checkin"] #view .card:has(#checkin-search){
  min-height:240px;
}
body[data-route="checkin"] #view input[type="search"]{
  min-height:48px;
  font-size:15px;
}
body[data-route="checkin"] #view .checkin-card{
  min-height:120px;
}

/* Giving / finance */
body[data-route="giving"] #view .stat,
body[data-route="dues"] #view .stat,
body[data-route="projects"] #view .stat{
  min-height:126px;
  padding:20px;
}
body[data-route="giving"] #view .stat .value,
body[data-route="dues"] #view .stat .value,
body[data-route="projects"] #view .stat .value{
  font-family:Georgia,"Times New Roman",serif;
  font-size:29px;
}
body[data-route="giving"] #view .tabs,
body[data-route="dues"] #view .tabs{
  margin:18px 0;
}
body[data-route="giving"] #view .card:has(table),
body[data-route="dues"] #view .card:has(table),
body[data-route="projects"] #view .card:has(table){
  padding:0!important;
}
body[data-route="giving"] #view .card:has(table) h2,
body[data-route="dues"] #view .card:has(table) h2,
body[data-route="projects"] #view .card:has(table) h2{
  padding:20px 20px 0;
}

/* Events */
body[data-route="events"] #view .grid.g2 > .card{
  min-height:205px;
  transition:transform .14s ease,box-shadow .14s ease;
}
body[data-route="events"] #view .grid.g2 > .card:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 25px rgba(16,35,68,.08);
}
body[data-route="events"] #view .calendar td{
  padding:10px!important;
  height:98px!important;
}
body[data-route="events"] #view .calendar td a{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Worship */
body[data-route="worship"] #view .card:has(table),
body[data-route="songs"] #view .card:has(table),
body[data-route="sermons"] #view .card:has(table),
body[data-route="announcements"] #view .card:has(table){
  padding:0!important;
}
body[data-route="worship"] #view .card h2,
body[data-route="songs"] #view .card h2,
body[data-route="sermons"] #view .card h2,
body[data-route="announcements"] #view .card h2{
  color:#102344;
  font-family:Georgia,"Times New Roman",serif;
}
body[data-route="songs"] #view .song-row,
body[data-route="sermons"] #view .sermon-row{
  min-height:62px;
}

/* Care / pastoral */
body[data-route="care"] #view .card,
body[data-route="shepherding"] #view .card,
body[data-route="prayer"] #view .card{
  box-shadow:0 6px 20px rgba(16,35,68,.05);
}
body[data-route="care"] #view .status-badge,
body[data-route="shepherding"] #view .status-badge{
  background:#F5F0E5;
}
body[data-route="prayer"] #view .banner{
  border-left:3px solid #C5963B;
}

/* Reports */
body[data-route="reports"] #view{
  max-width:1540px;
}
body[data-route="reports"] #view .report-chart-card{
  background:#FFF;
  box-shadow:0 7px 24px rgba(16,35,68,.06);
}
body[data-route="reports"] #view .report-chart-card:nth-child(3){
  min-height:430px!important;
}
body[data-route="reports"] #view .report-chart{
  overflow:hidden;
}
body[data-route="reports"] #view .report-line-chart{
  min-height:290px!important;
}
body[data-route="reports"] #view .report-pie-wrap{
  padding:8px 12px;
}

/* Admin */
body[data-route="users"] #view .user-table td{
  min-height:60px!important;
}
body[data-route="users"] #view .user-avatar{
  width:38px!important;
  height:38px!important;
}
body[data-route="users"] #view .role-badge{
  border-radius:999px;
  font-weight:750;
}
body[data-route="users"] #view .security-panel{
  border:1px solid #E4DED2;
  border-radius:12px;
  background:#FBF8F1;
}
body[data-route="audit"] #view table td:first-child{
  white-space:nowrap;
}
body[data-route="settings"] #view .card,
body[data-route="backup"] #view .card,
body[data-route="features"] #view .card,
body[data-route="usage"] #view .card,
body[data-route="subscription"] #view .card{
  min-height:130px;
}

/* My Church / branches */
body[data-route="branches"] #view .grid.g2 > .card{
  min-height:190px;
}
body[data-route="branches"] #view .card{
  border-top:3px solid #D0A54D;
}

/* Birthday months */
body[data-route="birthmonths"] #view .card{
  overflow:hidden;
}
body[data-route="birthmonths"] #view .grid{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
body[data-route="birthmonths"] #view .month-card{
  min-width:0;
}
@media(max-width:1100px){
  #view .workspace-summary{grid-template-columns:repeat(2,minmax(0,1fr));}
  body[data-route="birthmonths"] #view .grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:680px){
  #view .workspace-summary{grid-template-columns:1fr;}
  body[data-route="birthmonths"] #view .grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}


/* ==========================================================================
   GRACEHUB CONNECTED WORKSPACES — v38
   ========================================================================== */
#view .segment-card{
  position:relative;
  min-height:210px;
  display:flex;
  flex-direction:column;
  padding:22px!important;
}
#view .segment-card h3{
  margin:0 0 7px;
  color:#102344;
  font-family:Georgia,"Times New Roman",serif;
  font-size:19px;
}
#view .segment-card .segment-count{
  color:#245B4E;
  font-family:Georgia,"Times New Roman",serif;
  font-size:34px;
  font-weight:700;
  line-height:1;
  margin:6px 0;
}
#view .segment-card p{
  color:#778294;
  font-size:12px;
  margin:0 0 16px;
}
#view .segment-card .btn{
  margin-top:auto;
  align-self:flex-start;
}
#view .segment-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#F5EFE3;
  color:#A4772E;
  margin-bottom:13px;
}
#view .os-hero .btn{
  flex:0 0 auto;
  min-height:43px;
  padding:0 16px;
}
#view .task-line{
  min-height:66px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:10px 0;
  border-bottom:1px solid #EEEAE2;
}
#view .task-line:last-child{border-bottom:0;}
#view .task-line > div{min-width:0;}
#view .task-line b{color:#243550;font-size:13px;}
#view .task-line .muted{font-size:11px;margin-top:4px;}
#view .person360-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:20px 22px;
  margin-bottom:18px;
  border:1px solid #E4DED2;
  border-radius:15px;
  background:#FFFDF9;
  box-shadow:0 6px 20px rgba(16,35,68,.05);
}
#view .person360-head h2{
  margin:3px 0 7px;
  color:#102344;
  font-family:Georgia,"Times New Roman",serif;
  font-size:28px;
}
#view .person-meta{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  color:#718096;
  font-size:12px;
}
#view .person360-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-bottom:18px;
}
#view .person360-grid .card{
  min-height:150px;
}
#view .journey-current{
  color:#245B4E;
  font-family:Georgia,"Times New Roman",serif;
  font-size:25px;
  font-weight:700;
  margin:8px 0;
}
#view .person360-cols{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
  gap:18px;
}
#view .os-timeline{
  display:flex;
  flex-direction:column;
}
#view .os-timeline-item{
  position:relative;
  display:grid;
  grid-template-columns:14px 1fr;
  gap:12px;
  padding:12px 0 12px 2px;
  border-bottom:1px solid #EEEAE2;
}
#view .os-timeline-item:last-child{border-bottom:0;}
#view .os-dot{
  width:9px;
  height:9px;
  margin-top:5px;
  border:2px solid #2F6E57;
  border-radius:50%;
  background:#fff;
}
#view .os-timeline-item b{
  color:#253650;
  font-size:13px;
}
#view .os-timeline-item small{
  color:#9099A7;
  font-size:10px;
}
@media(max-width:900px){
  #view .person360-grid{grid-template-columns:1fr;}
  #view .person360-cols{grid-template-columns:1fr;}
  #view .person360-head{align-items:flex-start;flex-direction:column;}
}
@media(max-width:620px){
  #view .person360-head h2{font-size:24px;}
}


/* ==========================================================================\n   GRACEHUB v42 — visual and interaction repair pass\n   ========================================================================== */
#view .card{overflow:visible!important;}
#view .table-wrap{overflow-x:auto!important;overflow-y:visible!important;}
#view table{max-width:100%;}
#view td,#view th{vertical-align:middle;}

/* Full, usable date controls everywhere a module asks for a date. */
#view input.date-control,#view input[type="date"]{min-width:154px!important;min-height:44px!important;padding:9px 11px!important;border:1px solid #D9D5CC!important;border-radius:10px!important;background:#FFFEFB!important;color:#102344!important;font-size:13px!important;line-height:1.2!important;cursor:pointer;}
#view input.date-control:focus,#view input[type="date"]:focus{border-color:#B78935!important;box-shadow:0 0 0 3px rgba(183,137,53,.12)!important;outline:none!important;}
.date-range-toolbar,.giving-date-toolbar{gap:10px!important;align-items:flex-end!important;flex-wrap:wrap!important;}
.date-range-field{display:flex;flex-direction:column;gap:4px;min-width:154px;}
.date-range-field span{font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#788394;}
.calendar-head{align-items:flex-end!important;margin-bottom:14px!important;}
.calendar-picker{display:flex;flex-direction:column;gap:4px;font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#788394;}

/* Person profile photo */
.person-photo-row{display:flex;gap:16px;align-items:center;padding:14px 16px;margin:0 0 18px;border:1px solid #E4DED2;border-radius:13px;background:#FBF8F1;}
.person-photo-preview{width:78px;height:78px;border-radius:50%;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none;background:#F2EAD8;color:#A27429;position:relative;}
.person-photo-preview img{width:100%;height:100%;object-fit:cover;display:block;}
.person-photo-preview.empty{border:1px dashed #CFC5B2;}
.person-photo-placeholder{font-size:20px;font-weight:800;line-height:1;}
.person-photo-preview span:last-child{font-size:8px;position:absolute;bottom:5px;background:rgba(255,255,255,.88);padding:2px 6px;border-radius:99px;}
.person-photo-copy{min-width:0;display:flex;flex-direction:column;gap:5px;}
.person-photo-copy strong{font-size:13px;color:#102344;}
.person-photo-copy p{margin:0;color:#6F7B8D;font-size:11px;line-height:1.45;max-width:560px;}
.person-photo-copy small{font-size:9px;color:#8992A0;}
.photo-file{font-size:11px!important;min-height:38px!important;padding:7px!important;background:#fff!important;border:1px solid #D9D5CC!important;border-radius:9px!important;max-width:420px;}

/* Live dashboard search */
.gh-search{position:relative;z-index:90;}
.gh-search-popover{position:absolute;left:0;right:0;top:calc(100% + 8px);background:#fff;border:1px solid #E3DED4;border-radius:14px;box-shadow:0 18px 45px rgba(16,35,68,.14);padding:7px;max-height:430px;overflow:auto;}
.search-live-row{display:flex;align-items:center;gap:10px;padding:10px;border-radius:10px;text-decoration:none;color:#102344;}
.search-live-row:hover{background:#F7F2E8;}
.search-live-row>span:nth-child(2){min-width:0;flex:1;}
.search-live-row strong,.search-live-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.search-live-row strong{font-size:12px;}
.search-live-row small{font-size:9px;color:#7A8596;margin-top:2px;}
.search-live-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:#F2F5F8;flex:none;}
.search-live-icon.gold{background:#F8EFD9;color:#A27429;}
.search-live-icon .ico{background:transparent!important;box-shadow:none!important;width:16px!important;height:16px!important;}
.search-live-all{width:100%;margin-top:4px;border:0;border-top:1px solid #EEEAE2;border-radius:0 0 8px 8px;background:#fff;color:#A27429;font-weight:800;font-size:10px;padding:10px;cursor:pointer;}
.search-live-empty{padding:18px 12px;color:#748096;font-size:11px;text-align:center;}

/* Dashboard: restore hierarchy and breathing room. */
body[data-route="dashboard"] #view{padding:0 32px 60px!important;}
body[data-route="dashboard"] .gh-dashboard{max-width:1440px!important;margin:0 auto!important;overflow:visible!important;}
body[data-route="dashboard"] .gh-topbar{height:76px!important;padding:0 24px!important;margin:0 -24px 8px!important;}
body[data-route="dashboard"] .gh-search{width:min(560px,48%)!important;height:46px!important;border-radius:13px!important;padding:0 14px!important;}
body[data-route="dashboard"] .gh-search input{font-size:13px!important;}
body[data-route="dashboard"] .gh-top-actions{gap:10px!important;}
body[data-route="dashboard"] .gh-church-switch{min-width:250px!important;min-height:46px!important;}
body[data-route="dashboard"] .gh-icon-btn{width:46px!important;height:46px!important;}
body[data-route="dashboard"] .gh-user{min-height:46px!important;min-width:175px!important;}
body[data-route="dashboard"] .gh-welcome{min-height:190px!important;padding:34px 22px 30px!important;border-radius:0 0 16px 16px;}
body[data-route="dashboard"] .gh-welcome h1{font-size:40px!important;line-height:1.08!important;}
body[data-route="dashboard"] .gh-welcome h1 span{font-size:30px!important;}
body[data-route="dashboard"] .gh-welcome h2{font-size:21px!important;}
body[data-route="dashboard"] .gh-welcome p{font-size:13px!important;}
body[data-route="dashboard"] .gh-verse{font-size:14px!important;max-width:440px!important;}
body[data-route="dashboard"] .gh-kpis{gap:16px!important;margin:16px 0 20px!important;}
body[data-route="dashboard"] .gh-kpi{min-height:142px!important;padding:22px!important;border-radius:15px!important;}
body[data-route="dashboard"] .gh-kpi-icon{width:58px!important;height:58px!important;}
body[data-route="dashboard"] .gh-kpi small{font-size:12px!important;}
body[data-route="dashboard"] .gh-kpi strong{font-size:30px!important;}
body[data-route="dashboard"] .gh-kpi i{font-size:11px!important;}
body[data-route="dashboard"] .gh-kpi em{font-size:10px!important;}
body[data-route="dashboard"] .gh-card{padding:22px!important;border-radius:15px!important;}
body[data-route="dashboard"] .gh-chart-card{min-height:430px!important;}
body[data-route="dashboard"] .gh-chart{height:300px!important;min-height:300px!important;overflow:visible!important;}
body[data-route="dashboard"] .gh-chart svg{height:100%!important;overflow:visible!important;}
body[data-route="dashboard"] .gh-bars{height:270px!important;}
body[data-route="dashboard"] .gh-bar-track{height:200px!important;}
body[data-route="dashboard"] .gh-card-head h3{font-size:15px!important;}
body[data-route="dashboard"] .gh-card-head p{font-size:10px!important;}
body[data-route="dashboard"] .gh-event{padding:12px 0!important;}
body[data-route="dashboard"] .gh-event strong{font-size:11px!important;}
body[data-route="dashboard"] .gh-event small{font-size:9px!important;}
body[data-route="dashboard"] .gh-activity{padding:12px 0!important;}
body[data-route="dashboard"] .gh-activity strong{font-size:10px!important;}
body[data-route="dashboard"] .gh-activity small{font-size:9px!important;}
body[data-route="dashboard"] .gh-action strong{font-size:10px!important;}
body[data-route="dashboard"] .gh-action small{font-size:9px!important;}
body[data-route="dashboard"] .gh-promo{min-height:150px!important;margin-top:18px!important;padding:24px 30px!important;background-position:center 54%!important;}
body[data-route="dashboard"] .gh-promo-copy h3{font-size:24px!important;}
body[data-route="dashboard"] .gh-promo-copy p{font-size:10px!important;}
body[data-route="dashboard"] .gh-footer{font-size:9px!important;padding-top:14px!important;}

/* Lists should grow with their content instead of clipping after a handful of rows. */
body[data-route] #view .card:has(table){height:auto!important;max-height:none!important;}
body[data-route] #view .table-wrap table tbody tr{height:auto!important;}
body[data-route="visitors"] #view .card:has(table) .table-wrap{max-height:none!important;overflow-y:visible!important;}

@media(max-width:1100px){
  body[data-route="dashboard"] #view{padding:0 20px 50px!important;}
  body[data-route="dashboard"] .gh-search{width:44%!important;}
  body[data-route="dashboard"] .gh-church-switch{min-width:210px!important;}
  body[data-route="dashboard"] .gh-welcome h1{font-size:35px!important;}
}
@media(max-width:860px){
  body[data-route="dashboard"] #view{padding:0 14px 40px!important;}
  body[data-route="dashboard"] .gh-topbar{margin:0 -14px 6px!important;padding:10px 14px!important;}
  body[data-route="dashboard"] .gh-search{width:100%!important;order:2;}
  body[data-route="dashboard"] .gh-top-actions{order:1;width:100%;justify-content:flex-end;}
  body[data-route="dashboard"] .gh-welcome{min-height:150px!important;padding:26px 8px!important;}
  body[data-route="dashboard"] .gh-welcome h1{font-size:31px!important;}
  body[data-route="dashboard"] .gh-verse{display:none;}
  body[data-route="dashboard"] .gh-chart-card{min-height:380px!important;}
  body[data-route="dashboard"] .gh-chart{height:255px!important;min-height:255px!important;}
  body[data-route="dashboard"] .gh-bars{height:230px!important;}
  body[data-route="dashboard"] .gh-bar-track{height:165px!important;}
}
@media(max-width:560px){
  body[data-route="dashboard"] #view{padding:0 10px 32px!important;}
  body[data-route="dashboard"] .gh-topbar{margin:0 -10px 4px!important;}
  body[data-route="dashboard"] .gh-welcome h1{font-size:27px!important;}
  body[data-route="dashboard"] .gh-kpi{min-height:112px!important;padding:17px!important;}
  body[data-route="dashboard"] .gh-chart-card{min-height:350px!important;}
  body[data-route="dashboard"] .gh-chart{height:225px!important;min-height:225px!important;}
  body[data-route="dashboard"] .gh-promo{min-height:130px!important;padding:20px!important;}
  .person-photo-row{align-items:flex-start;}
}


/* ========================================================================
   GRACEHUB v43 — FINAL VISUAL/INTERACTION REPAIR
   ======================================================================== */
:root{
  --gh-navy:#132B52;
  --gh-navy-2:#203B62;
  --gh-gold:#B98A32;
  --gh-gold-soft:#F6EEDB;
  --gh-cream:#F8F6F0;
  --gh-paper:#FFFFFF;
  --gh-line:#E5E0D6;
  --gh-muted:#73809A;
  --gh-green:#2F6E57;
  --sans:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
}
html,body{font-family:var(--sans)!important;background:var(--gh-cream)!important;color:var(--gh-navy)!important;font-size:15px!important;line-height:1.5!important;}
body h1,body h2,body h3,body h4{font-family:var(--sans);}

/* Light GraceHub rail — the navigation should feel like part of the product,
   not a separate dark application. */
#sidebar{width:232px!important;flex-basis:232px!important;background:#fff!important;color:var(--gh-navy)!important;border-right:1px solid var(--gh-line)!important;box-shadow:none!important;}
#sidebar .brand{background:#fff!important;border-bottom:1px solid #F0ECE4!important;padding:20px 16px 16px!important;}
#sidebar .brand-name{color:var(--gh-navy)!important;font-family:Georgia,'Times New Roman',serif!important;font-size:23px!important;font-weight:700!important;}
#sidebar .brand-sub{color:#7B8597!important;}
#nav a{color:#334766!important;font-size:13px!important;font-weight:600!important;}
#nav a:hover{background:#F7F3EA!important;color:var(--gh-navy)!important;}
#nav a.active{background:#F3EEE2!important;color:var(--gh-navy)!important;box-shadow:inset 3px 0 0 var(--gh-gold)!important;}
#nav a .ico{color:currentColor!important;}
#nav .nav-group{color:#9A927F!important;}
#account-footer{background:#fff!important;border-top:1px solid var(--gh-line)!important;}

/* Never let module content slide behind the page header. */
body:not([data-route="dashboard"]) header.page{position:relative!important;top:auto!important;z-index:2!important;min-height:88px!important;padding:20px 34px 18px!important;background:#fff!important;border-bottom:1px solid var(--gh-line)!important;box-shadow:0 1px 0 rgba(19,43,82,.025)!important;}
body:not([data-route="dashboard"]) header.page #page-title h1{font-size:31px!important;line-height:1.12!important;font-weight:700!important;letter-spacing:-.035em!important;color:var(--gh-navy)!important;}
body:not([data-route="dashboard"]) header.page #page-title .sub{font-size:13px!important;color:#7A879D!important;margin-top:5px!important;}
body:not([data-route="dashboard"]) #view{padding:30px 34px 72px!important;max-width:1540px!important;margin:0 auto!important;}

/* Dashboard typography: fewer tiny 8–10px labels, stronger hierarchy. */
body[data-route="dashboard"] #view{padding:0 34px 60px!important;}
body[data-route="dashboard"] .gh-dashboard{max-width:1440px!important;margin:0 auto!important;overflow:visible!important;}
body[data-route="dashboard"] .gh-topbar{height:76px!important;padding:0 24px!important;margin:0 -24px 10px!important;background:#fff!important;border-bottom:1px solid var(--gh-line)!important;}
body[data-route="dashboard"] .gh-search{height:46px!important;width:min(560px,48%)!important;background:#FAF9F6!important;border-color:#DDD8CE!important;border-radius:13px!important;}
body[data-route="dashboard"] .gh-search input{font-size:14px!important;color:var(--gh-navy)!important;}
body[data-route="dashboard"] .gh-church-switch,body[data-route="dashboard"] .gh-user,body[data-route="dashboard"] .gh-icon-btn{color:var(--gh-navy)!important;text-decoration:none!important;}
body[data-route="dashboard"] .gh-welcome{padding:38px 22px 30px!important;min-height:188px!important;}
body[data-route="dashboard"] .gh-eyebrow{font-size:10px!important;}
body[data-route="dashboard"] .gh-welcome h1{font-family:Georgia,'Times New Roman',serif!important;font-size:43px!important;font-weight:500!important;line-height:1.05!important;color:var(--gh-navy)!important;}
body[data-route="dashboard"] .gh-welcome h1 span{font-family:var(--sans)!important;font-size:31px!important;font-weight:500!important;}
body[data-route="dashboard"] .gh-welcome h2{font-size:21px!important;line-height:1.3!important;}
body[data-route="dashboard"] .gh-welcome p{font-size:13px!important;}
body[data-route="dashboard"] .gh-verse{font-size:14px!important;line-height:1.6!important;}
body[data-route="dashboard"] .gh-kpis{gap:17px!important;margin:18px 0 22px!important;}
body[data-route="dashboard"] .gh-kpi{min-height:142px!important;padding:22px!important;border-radius:16px!important;}
body[data-route="dashboard"] .gh-kpi small{font-size:12px!important;}
body[data-route="dashboard"] .gh-kpi strong{font-family:Georgia,'Times New Roman',serif!important;font-size:31px!important;}
body[data-route="dashboard"] .gh-kpi i{font-size:11px!important;}
body[data-route="dashboard"] .gh-kpi em{font-size:10px!important;}
body[data-route="dashboard"] .gh-card{padding:23px!important;border-radius:16px!important;}
body[data-route="dashboard"] .gh-card-head h3{font-size:16px!important;}
body[data-route="dashboard"] .gh-card-head p{font-size:11px!important;}
body[data-route="dashboard"] .gh-event strong{font-size:12px!important;}
body[data-route="dashboard"] .gh-event small{font-size:10px!important;}
body[data-route="dashboard"] .gh-activity strong{font-size:11px!important;}
body[data-route="dashboard"] .gh-activity small{font-size:10px!important;}
body[data-route="dashboard"] .gh-action strong{font-size:11px!important;}
body[data-route="dashboard"] .gh-action small{font-size:10px!important;}

/* Clean promotional visual: HTML supplies all words; the photograph is only
   the people/landscape crop so text can never bleed or become blurry twice. */
body[data-route="dashboard"] .gh-promo{min-height:210px!important;margin-top:20px!important;padding:0 0 0 34px!important;position:relative!important;display:flex!important;align-items:center!important;overflow:hidden!important;background:#142D4F!important;background-image:none!important;border-radius:17px!important;}
body[data-route="dashboard"] .gh-promo:after{content:'';position:absolute;inset:0 0 0 43%;background:linear-gradient(90deg,#142D4F 0%,rgba(20,45,79,.25) 20%,rgba(20,45,79,0) 48%),url('../assets/gracehub-promo-clean.jpg') right center/auto 100% no-repeat;pointer-events:none;}
body[data-route="dashboard"] .gh-promo-copy{position:relative!important;z-index:2!important;max-width:460px!important;color:#fff!important;}
body[data-route="dashboard"] .gh-promo-copy>span{font-size:10px!important;letter-spacing:.22em!important;}
body[data-route="dashboard"] .gh-promo-copy h3{font-family:Georgia,'Times New Roman',serif!important;font-size:30px!important;line-height:1.04!important;margin:7px 0 10px!important;color:#fff!important;}
body[data-route="dashboard"] .gh-promo-copy p{font-size:12px!important;line-height:1.5!important;max-width:430px!important;}
body[data-route="dashboard"] .gh-promo-copy a{font-size:11px!important;padding:10px 15px!important;background:#0D2342!important;border:1px solid rgba(255,255,255,.12)!important;}

/* Reports: stable header, real charts, and a readable period control. */
body[data-route="reports"] #view{padding-top:28px!important;}
body[data-route="reports"] #view .report-section-intro{margin:0 0 16px!important;padding:0 2px!important;}
body[data-route="reports"] #view .report-section-intro h2{font-family:Georgia,'Times New Roman',serif!important;font-size:30px!important;line-height:1.1!important;margin:0 0 6px!important;color:var(--gh-navy)!important;}
body[data-route="reports"] #view .report-section-intro p{font-size:14px!important;color:#71809A!important;}
body[data-route="reports"] #view .report-visual-grid{grid-template-columns:minmax(0,1.28fr) minmax(380px,.92fr)!important;gap:20px!important;margin:0 0 22px!important;}
body[data-route="reports"] #view .report-chart-card{min-height:430px!important;padding:25px!important;border-radius:16px!important;overflow:visible!important;background:#fff!important;}
body[data-route="reports"] #view .report-chart-card:nth-child(3){grid-column:1 / -1!important;}
body[data-route="reports"] #view .report-chart-head{min-height:68px!important;margin-bottom:14px!important;}
body[data-route="reports"] #view .report-chart-head h3{font-size:21px!important;line-height:1.2!important;margin:4px 0 5px!important;}
body[data-route="reports"] #view .report-chart-head p{font-size:13px!important;}
body[data-route="reports"] #view .report-chart-total{font-size:29px!important;}
body[data-route="reports"] #view .report-line-chart{height:300px!important;min-height:300px!important;margin:0!important;}
body[data-route="reports"] #view .report-bar-chart{height:300px!important;padding:16px 8px 0!important;}
body[data-route="reports"] #view .report-bar-track{height:220px!important;max-width:62px!important;}
body[data-route="reports"] #view .report-pie-wrap{min-height:330px!important;padding:0!important;}
body[data-route="reports"] #view .report-pie{width:min(330px,100%)!important;}
body[data-route="reports"] #view .report-legend-item{font-size:13px!important;}
body[data-route="reports"] #view .report-chart-empty-frame{height:300px!important;display:flex!important;align-items:center!important;justify-content:center!important;}
body[data-route="reports"] #view .report-chart-empty{min-height:180px!important;width:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:7px!important;background:#FBFAF7!important;border:1px dashed #D9D3C6!important;border-radius:12px!important;font-size:13px!important;}
body[data-route="reports"] #view .report-chart-empty strong{font-size:15px!important;color:var(--gh-navy)!important;}
body[data-route="reports"] #view .report-chart-empty a{font-size:12px!important;color:#A27429!important;font-weight:700!important;}
body[data-route="reports"] #view .toolbar{margin-top:0!important;margin-bottom:22px!important;padding:13px 16px!important;min-height:64px!important;gap:12px!important;align-items:center!important;}
body[data-route="reports"] #view .toolbar select,body[data-route="reports"] #view .toolbar input[type="date"]{min-height:44px!important;font-size:13px!important;}

/* Feature access: consistent cards and a deliberate 4-column product grid. */
body[data-route="features"] #view>.grid.g2{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:20px!important;}
body[data-route="features"] #view .feature-access-card{min-height:172px!important;padding:25px!important;display:flex!important;align-items:flex-start!important;border-radius:16px!important;border-top:3px solid var(--gh-gold)!important;}
body[data-route="features"] #view .feature-access-card h3{font-size:15px!important;text-transform:uppercase!important;letter-spacing:.01em!important;}
body[data-route="features"] #view .feature-access-card p{font-size:13px!important;line-height:1.55!important;max-width:260px!important;}
body[data-route="features"] #view .feature-access-card .status{font-size:11px!important;padding:6px 10px!important;margin-top:auto!important;}

/* Dates are always full date pickers wherever a date is editable/filterable. */
#view input[type="date"],#view input.date-control{appearance:auto!important;-webkit-appearance:auto!important;min-height:44px!important;min-width:155px!important;padding:9px 11px!important;border:1px solid #D8D3C8!important;border-radius:10px!important;background:#fff!important;color:var(--gh-navy)!important;font-size:13px!important;font-family:var(--sans)!important;}
.date-range-field{display:flex!important;align-items:center!important;gap:8px!important;}
.date-range-field>span{font-size:11px!important;font-weight:700!important;color:#737F94!important;white-space:nowrap!important;}
.date-range-toolbar{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;padding:12px 14px!important;}

/* Tables/lists: never clip a short list. */
#view .card,#view .erp-card{overflow:visible!important;max-height:none!important;height:auto!important;}
#view .table-wrap{overflow-x:auto!important;overflow-y:visible!important;max-height:none!important;height:auto!important;}
#view table tbody{overflow:visible!important;}
#view table tbody tr{height:auto!important;min-height:52px!important;}
#view table td,#view table th{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}

@media(max-width:1180px){
 body[data-route="features"] #view>.grid.g2{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
 body[data-route="reports"] #view .report-visual-grid{grid-template-columns:1fr!important;}
 body[data-route="reports"] #view .report-chart-card:nth-child(3){grid-column:auto!important;}
}
@media(max-width:860px){
 #sidebar{width:250px!important;flex-basis:250px!important;}
 body:not([data-route="dashboard"]) header.page{min-height:80px!important;padding:16px 20px!important;}
 body:not([data-route="dashboard"]) #view{padding:22px 20px 56px!important;}
 body[data-route="dashboard"] #view{padding:0 16px 46px!important;}
 body[data-route="dashboard"] .gh-welcome h1{font-size:34px!important;}
 body[data-route="dashboard"] .gh-welcome h1 span{font-size:25px!important;}
 body[data-route="dashboard"] .gh-search{width:100%!important;}
 body[data-route="dashboard"] .gh-promo{min-height:230px!important;padding:26px!important;}
 body[data-route="dashboard"] .gh-promo:after{inset:35% 0 0 0;opacity:.55;}
 body[data-route="dashboard"] .gh-promo-copy{max-width:100%!important;}
 body[data-route="features"] #view>.grid.g2{grid-template-columns:1fr!important;}
}
@media(max-width:560px){
 body:not([data-route="dashboard"]) header.page h1,body:not([data-route="dashboard"]) header.page #page-title h1{font-size:24px!important;}
 body:not([data-route="dashboard"]) #view{padding:18px 12px 46px!important;}
 body[data-route="dashboard"] #view{padding:0 10px 32px!important;}
 body[data-route="dashboard"] .gh-welcome{padding:28px 8px 22px!important;}
 body[data-route="dashboard"] .gh-welcome h1{font-size:29px!important;}
 body[data-route="dashboard"] .gh-kpis{grid-template-columns:1fr!important;}
 body[data-route="dashboard"] .gh-promo{min-height:260px!important;}
 body[data-route="reports"] #view .report-chart-card{padding:18px!important;min-height:360px!important;}
 body[data-route="reports"] #view .report-line-chart{height:250px!important;min-height:250px!important;}
 body[data-route="reports"] #view .report-bar-chart{height:250px!important;}
}
