@font-face { font-family: ChurchSans; src: url('/assets/assets/fonts/DMSans.ttf') format('truetype'); font-display: swap; }
:root {
    color-scheme: light;
    --ink: #193849;
    --muted: #637783;
    --blue: #0369a1;
    --blue-dark: #07547d;
    --blue-bright: #1581b8;
    --navy: #15364b;
    --line: #e1e7e8;
    --bg: #f6f7f4;
    --card: #fff;
    --pale: #eaf4f9;
    --danger: #b03d37;
    --shadow: 0 4px 20px rgb(25 56 73 / 3%);
}
* { box-sizing: border-box; }
html { font-family: ChurchSans, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #1682b6; outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.65rem, 2.5vw, 2.2rem); letter-spacing: -.045em; line-height: 1.2; margin-bottom: .5rem; font-weight: 700; }
h2 { font-size: 1.08rem; line-height: 1.4; letter-spacing: -.025em; margin-bottom: .65rem; }
h3 { font-size: 1rem; letter-spacing: -.015em; }
svg { display: inline-block; vertical-align: middle; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.eyebrow, .nav-label { color: #697f89; font-weight: 700; font-size: .66rem; letter-spacing: .14em; line-height: 1.5; }
[hidden], [x-cloak] { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: .8rem 1rem; background: var(--navy); color: #fff; border-radius: 10px; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .75rem 1.1rem; border: 1px solid transparent; border-radius: 9px; font-weight: 600; font-size: .86rem; line-height: 1.25; text-align: center; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 3px 7px rgb(3 105 161 / 12%); }
.button-primary:hover { background: var(--blue-dark); box-shadow: 0 5px 12px rgb(3 105 161 / 18%); }
.button-outline { background: #fff; border-color: #cfdadf; color: var(--ink); }
.button-outline:hover { background: #f4f9fb; border-color: #a9c6d5; }
.button-full { width: 100%; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.icon-button:hover { background: var(--pale); }
.text-button { border: 0; background: none; color: var(--blue); font-weight: 600; font-size: .85rem; min-height: 36px; padding: .35rem .3rem; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-button.danger { color: var(--danger); }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--navy); font-weight: 750; letter-spacing: -.05em; font-size: 1.4rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px 11px 11px 3px; background: var(--blue); color: #fff; font-size: 1.3rem; font-weight: 700; line-height: 1; box-shadow: 0 3px 8px rgb(3 105 161 / 10%); }
.brand-dot { color: #57a3c7; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 1.15rem; min-width: 0; padding: 1.8rem 1.05rem 1rem; background: #fff; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #d1dfe4 transparent; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 0 .6rem .6rem; }
.church-switch { display: flex; gap: .65rem; align-items: center; padding: .85rem .7rem; border: 1px solid #e0e8eb; border-radius: 12px; background: #f8fafb; }
.church-switch:hover { text-decoration: none; border-color: #abcad9; background: #f3f8fa; }
.church-switch-icon { display: grid; place-items: center; width: 35px; height: 38px; border-radius: 8px; flex-shrink: 0; color: var(--blue); background: #e4f0f6; }
.church-switch > span:nth-child(2) { min-width: 0; flex: 1; }
.church-switch .eyebrow { display: block; font-size: .56rem; letter-spacing: .09em; margin-bottom: .2rem; }
.church-switch strong { display: block; font-size: .78rem; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
.church-switch > .icon { width: 14px; height: 14px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: .2rem; }
.nav-group a, .sidebar-bottom a, .sidebar-bottom button { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 42px; padding: .65rem .8rem; border: 0; border-radius: 8px; background: transparent; color: #5d717c; font-size: .82rem; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-group .icon, .sidebar-bottom .icon { width: 18px; height: 18px; color: #80929b; }
.nav-group a:hover, .sidebar-bottom a:hover, .sidebar-bottom button:hover { background: #f1f6f8; color: var(--blue-dark); text-decoration: none; }
.nav-group a[aria-current=page], .sidebar-bottom a[aria-current=page] { background: #eaf4f9; color: var(--blue); font-weight: 650; }
.nav-group a[aria-current=page] .icon, .sidebar-bottom a[aria-current=page] .icon { color: var(--blue); }
.nav-label { padding: .35rem .8rem .55rem; font-size: .59rem; }
.sidebar-bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.sidebar-caption { margin: .85rem .8rem .25rem; font-size: .66rem; color: #7a8c95; }
.sidebar-close, .menu-toggle, .sidebar-scrim { display: none; }
.main-column { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem clamp(1.25rem, 3vw, 2.7rem); background: rgb(255 255 255 / 85%); border-bottom: 1px solid var(--line); }
.topbar-start, .topbar-breadcrumb { display: flex; align-items: center; gap: .8rem; }
.topbar-breadcrumb { font-size: .78rem; color: #768a94; }
.topbar-breadcrumb .icon { width: 13px; height: 13px; color: #9aabb3; }
.topbar-breadcrumb strong { color: var(--ink); font-weight: 550; }
.account-link { display: flex; align-items: center; gap: .7rem; }
.account-link:hover { text-decoration: none; }
.account-name { font-size: .78rem; font-weight: 600; text-align: right; }
.account-name small { display: block; font-size: .65rem; color: var(--muted); font-weight: 400; margin-top: .1rem; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e7edf1; color: var(--navy); font-weight: 650; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 0 0 1px #dfe7ea; }
.content { width: 100%; max-width: 1420px; margin: 0 auto; padding: clamp(1.3rem, 3vw, 2.7rem); flex: 1; }
.content:focus { outline: none; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; margin: 0 clamp(1.3rem, 3vw, 2.7rem); padding: 1rem 0 1.4rem; border-top: 1px solid var(--line); font-size: .66rem; color: #788b95; }
.app-footer > span:first-child { font-weight: 650; }
.stack { display: flex; flex-direction: column; gap: 1.5rem; }
.stack.narrow { max-width: 900px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.page-heading .muted { font-size: .88rem; margin: .35rem 0 0; line-height: 1.6; }
.card, .empty-panel { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; box-shadow: var(--shadow); }
.empty-panel { padding: 3rem 1.5rem; text-align: center; color: var(--muted); grid-column: 1 / -1; border-style: dashed; box-shadow: none; }
.empty-panel h2 { color: var(--ink); }
.empty-panel p { max-width: 44ch; margin: .5rem auto 1rem; font-size: .9rem; }
.empty-panel .button { margin-top: .5rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.card-header h2 { margin: 0; }
.card-header > a { color: var(--blue); font-size: .8rem; font-weight: 600; }
.dashboard-grid, .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.mini-item { border-top: 1px solid var(--line); padding: 1rem 0; }
.mini-item:first-of-type { border-top: 0; }
.mini-item p { color: var(--muted); font-size: .86rem; margin: .35rem 0 0; line-height: 1.6; }
.church-card { display: flex; flex-direction: column; align-items: flex-start; padding: 1.65rem; transition: border-color .2s, box-shadow .2s; }
.church-card:hover { border-color: #b2cddc; box-shadow: 0 8px 26px rgb(25 56 73 / 6%); }
.church-card h2 { margin: 1.1rem 0 .4rem; }
.church-card p { font-size: .85rem; }
.church-card .muted { margin-bottom: 1rem; }
.church-card .button { margin-top: auto; width: 100%; }
.cover-image { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 10px; background: #edf3f5; flex-shrink: 0; }
.cover-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.cover-image .cover-photo { position: absolute; inset: 0; }
.church-cover { aspect-ratio: 16 / 9; }
.event-cover { aspect-ratio: 16 / 9; max-height: 230px; margin-bottom: 1.15rem; }
.section-heading-illustrated { display: grid; grid-template-columns: minmax(0, 1fr) 156px auto; gap: 1.25rem; }
.section-heading-illustrated:not(:has(> button)) { grid-template-columns: minmax(0, 1fr) 156px; }
.section-heading-art { width: 156px; aspect-ratio: 3 / 2; border: 1px solid #e5eceb; border-radius: 12px; }
.section-heading-copy { min-width: 0; }
.section-heading-illustrated > .button { justify-self: end; }
@media (max-width: 700px) {
    .section-heading-illustrated, .section-heading-illustrated:not(:has(> button)) { grid-template-columns: minmax(0, 1fr) 104px; gap: 1rem; }
    .section-heading-art { width: 104px; }
    .section-heading-illustrated > .button { grid-column: 1 / -1; justify-self: start; }
}
.church-icon, .product-placeholder { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--pale); color: var(--blue); font-size: 1.5rem; }
.records { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.record { display: flex; flex-direction: column; }
.record-top { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.record-top > div { min-width: 0; }
.record h2 { margin-bottom: .35rem; overflow-wrap: anywhere; }
.record-meta { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.record-body { white-space: normal; line-height: 1.75; margin: 1rem 0; color: #526976; font-size: .9rem; overflow-wrap: anywhere; }
.record > .muted { font-size: .85rem; margin-top: .7rem; overflow-wrap: anywhere; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; padding-top: .75rem; margin-top: auto; }
.record-actions:empty { display: none; }
.pill { display: inline-flex; background: #edf5f8; border: 1px solid #dfebf1; border-radius: 6px; padding: .28rem .6rem; color: #326781; font-weight: 500; font-size: .67rem; white-space: nowrap; }
.response-box { padding: 1rem; background: #f0f7f7; border-left: 3px solid #5c9d9c; border-radius: 8px; margin-top: 1rem; font-size: .85rem; }
.response-box p { margin: .35rem 0 0; }
.comments { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.comments p { font-size: .88rem; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: .6rem; margin-top: 1rem; }
.inline-form input { flex: 1; min-width: 0; }
.link-list { display: flex; flex-direction: column; }
.link-list a { border-top: 1px solid var(--line); padding: .85rem 0; display: flex; justify-content: space-between; color: var(--blue); font-weight: 600; font-size: .88rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 1.4rem; box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--muted); font-size: .8rem; }
.stat-card strong { display: block; color: var(--navy); font-size: 2.1rem; font-weight: 650; letter-spacing: -.05em; margin-top: .45rem; }
.table-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding: 1rem 0; font-size: .88rem; }
.table-row:first-of-type { border-top: 0; }
.table-row > * { min-width: 0; overflow-wrap: anywhere; }
.form-stack { display: flex; flex-direction: column; gap: 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-stack label, .search-label { display: flex; flex-direction: column; gap: .45rem; color: #3b5563; font-size: .82rem; font-weight: 600; }
.form-stack input:not([type=checkbox]), .form-stack textarea, .form-stack select, .search-label input, .inline-form input { width: 100%; min-height: 46px; background: #fff; border: 1px solid #cfdadf; border-radius: 8px; padding: .75rem .9rem; color: var(--ink); outline: none; font-size: .88rem; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #81929a; opacity: 1; }
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus, .search-label input:focus, .inline-form input:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 3px #e5f2f9; background: #fff; }
.form-stack textarea { resize: vertical; }
.colour-field, .picker-field { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.colour-controls, .picker-control { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.form-stack input.colour-swatch { width: 46px; height: 46px; min-height: 46px; flex: 0 0 46px; padding: 5px; cursor: pointer; border-radius: 9px; }
.colour-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.colour-swatch::-webkit-color-swatch { border: 1px solid rgb(25 56 73 / 12%); border-radius: 4px; }
.colour-swatch::-moz-color-swatch { border: 1px solid rgb(25 56 73 / 12%); border-radius: 4px; }
.form-stack input.colour-hex { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.colour-reset { flex: 0 0 auto; min-height: 44px; padding: .4rem .25rem; font-size: .78rem; }
.colour-field > small, #church-date-format-help { font-size: .72rem; font-weight: 400; line-height: 1.5; }
.form-stack input.picker-input { flex: 1; min-width: 0; }
.picker-trigger { flex: 0 0 auto; min-height: 46px; padding: .7rem .8rem; font-size: .8rem; }
.check-label { display: flex; align-items: center; gap: .6rem; font-weight: 500; min-height: 32px; }
.check-label input { width: 18px; height: 18px; accent-color: var(--blue); flex: 0 0 auto; }
.form-actions { display: flex; flex-wrap: wrap; gap: .7rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.search-label { max-width: 460px; width: 100%; }
.field-error { color: var(--danger); font-size: .8rem; }
.editor-card { border-color: #b6d3e2; }
.alert { border-radius: 10px; padding: .95rem 1.1rem; font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; }
.alert-error { background: #fdf1ef; color: #943c35; border: 1px solid #efcec9; }
.alert-success { background: #edf7f2; color: #2b6f52; border: 1px solid #cde6d9; }
.alert-warning { background: #fdf7e9; color: #795d24; border: 1px solid #eadfbd; }
.inline-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.inline-between p { margin: .35rem 0 0; font-size: .85rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.product-card { display: flex; flex-direction: column; }
.product-card img, .product-placeholder { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 1.25rem; }
.product-placeholder { display: grid; place-items: center; background: #edf3f5; color: #6990a4; }
.product-placeholder .icon { width: 48px; height: 48px; }
.product-card h2 { margin-bottom: .3rem; }
.product-card > p { font-size: .85rem; line-height: 1.6; }
.product-card .price { color: var(--navy); margin-top: auto; font-size: 1.25rem; letter-spacing: -.03em; }
.product-card .record-actions { gap: .5rem; }
.or-line { display: flex; align-items: center; gap: 1rem; color: var(--muted); margin: 1.4rem 0; font-size: .78rem; }
.or-line::before, .or-line::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.auth-foot { text-align: center; color: var(--muted); margin: 1.5rem 0 0; font-size: .85rem; }
.auth-foot a { color: var(--blue); font-weight: 650; }
@media (min-width: 1500px) { .app-shell { grid-template-columns: 270px minmax(0, 1fr); } .sidebar { padding-left: 1.3rem; padding-right: 1.3rem; } }
@media (max-width: 1150px) { .app-shell { grid-template-columns: 230px minmax(0, 1fr); } .dashboard-grid, .card-grid, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sidebar { padding-left: .75rem; padding-right: .75rem; } }
@media (max-width: 900px) {
    body.navigation-open { overflow: hidden; }
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: min(300px, 86vw); height: 100dvh; transform: translateX(-100%); transition: transform .22s ease; padding: 1.25rem 1rem; visibility: hidden; }
    .sidebar.is-open { transform: translateX(0); visibility: visible; }
    .sidebar-close, .menu-toggle { display: inline-flex; flex: 0 0 auto; }
    .sidebar-close { width: 32px; height: 32px; border: 0; }
    .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: rgb(10 28 40 / 45%); backdrop-filter: blur(3px); cursor: default; }
    .topbar { min-height: 72px; padding: .8rem 1.35rem; }
    .topbar-breadcrumb { gap: .6rem; }
    .main-column { min-height: 100dvh; }
}
@media (max-width: 640px) {
    .topbar { padding: .75rem 1rem; gap: .6rem; }
    .topbar-start { gap: .7rem; }
    .topbar-breadcrumb { font-size: 0; gap: 0; }
    .topbar-breadcrumb > .icon { display: none; }
    .topbar-breadcrumb strong { font-size: .8rem; }
    .account-name { display: none; }
    .content { padding: 1.35rem 1rem 2rem; }
    .stack { gap: 1.2rem; }
    .page-heading { align-items: flex-start; flex-wrap: wrap; }
    .page-heading h1 { font-size: 1.75rem; }
    .records, .dashboard-grid, .card-grid, .product-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-all { grid-column: auto; }
    .inline-between { align-items: flex-start; flex-direction: column; }
    .card { padding: 1.2rem; border-radius: 12px; }
    .record-top { flex-wrap: wrap; }
    .record-top > div { flex: 1 1 160px; }
    .stat-card { padding: 1.1rem; }
    .stat-card strong { font-size: 1.9rem; }
    .form-stack input:not([type=checkbox]), .form-stack textarea, .form-stack select, .search-label input, .inline-form input { font-size: 16px; }
    .app-footer { margin: 0 1rem; font-size: .6rem; }
}
@media (max-width: 380px) { .stats-grid { grid-template-columns: 1fr; } .inline-form { flex-wrap: wrap; } .inline-form input { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
.member-identity { display: flex; align-items: center; gap: .8rem; }
.member-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: #edf3f5; color: #4e7c92; font-size: 1rem; font-weight: 600; }
.member-identity > div { min-width: 0; }
.member-card h2 { font-size: .97rem; }
.member-card .record-actions { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .65rem; }
.product-placeholder .icon { width: 44px; height: 44px; stroke-width: 1.1; }
.order-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; align-items: start; }
.form-stack > .button { align-self: flex-start; min-width: 150px; }
@media (max-width: 640px) { .order-grid { grid-template-columns: 1fr; } }
