:root {
  color-scheme: light;
  --ink: #233635;
  --navy: #173c3d;
  --navy-dark: #102e30;
  --gold: #c49a58;
  --paper: #f5f6f3;
  --white: #fff;
  --muted: #77827e;
  --line: #e5e9e4;
  --green: #347455;
  --red: #a44e45;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.55 "DM Sans", Arial, sans-serif; }
a { color: var(--navy); }
button, input, textarea { font: inherit; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; top: 0; right: auto; bottom: 0; left: 0; z-index: 10; display: flex; width: 252px; flex-direction: column; padding: 28px 17px 18px; background: var(--navy-dark); color: #fff; }
.sidebar-brand { display: flex; align-items: center; padding: 0 8px 34px; color: #fff; text-decoration: none; }
.admin-brand-logo { display: block; width: 42px; height: 42px; flex: 0 0 42px; margin-right: 12px; object-fit: contain; }
.brand-copy strong, .brand-copy small, .login-brand strong, .login-brand small { display: block; }
.brand-copy strong { font: 800 12px "Manrope", Arial, sans-serif; letter-spacing: .13em; }
.brand-copy small { margin-top: 4px; color: #9aafaa; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.sidebar-label { margin: 0 12px 9px; color: #849a96; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.sidebar-nav { display: block; }
.sidebar-toggle { display: none; }
.sidebar-link { display: flex; min-height: 46px; align-items: center; margin-bottom: 5px; padding: 8px 12px; border-left: 3px solid transparent; color: #bac9c5; font-size: 12px; font-weight: 600; text-decoration: none; transition: background .16s ease, color .16s ease; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.is-active { border-left-color: var(--gold); background: rgba(255,255,255,.09); color: #fff; }
.sidebar-icon { display: inline-flex; width: 28px; height: 28px; flex: 0 0 28px; align-items: center; justify-content: center; margin-right: 11px; border: 1px solid rgba(255,255,255,.15); color: #d5b476; font-size: 15px; }
.sidebar-bottom { margin-top: auto; }
.website-link { display: block; padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.13); color: #fff; font-size: 11px; font-weight: 600; text-decoration: none; }
.website-link span { margin-right: 8px; color: #d5b476; font-size: 15px; }
.sidebar-bottom p { margin: 0; padding: 0 12px; color: #8fa29e; font-size: 10px; }

.admin-main { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; min-height: 74px; align-items: center; justify-content: space-between; padding: 11px 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.topbar-title span, .topbar-title strong { display: block; }
.topbar-title span { margin-bottom: 3px; color: #84908b; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.topbar-title strong { color: var(--navy); font: 700 14px "Manrope", Arial, sans-serif; }
.account { position: relative; display: flex; align-items: center; }
.account-avatar { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; margin-right: 10px; border-radius: 50%; background: #e8eee9; color: var(--navy); font-size: 12px; font-weight: 700; }
.account-name { max-width: 180px; overflow: hidden; color: #52615d; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-toggle { display: inline-flex; min-height: 42px; align-items: center; padding: 4px 8px; border: 1px solid transparent; border-radius: 24px; background: transparent; color: inherit; cursor: pointer; }
.account-menu-toggle:hover, .account-menu-toggle:focus-visible, .account-menu-toggle[aria-expanded="true"] { border-color: var(--line); background: #f7f8f5; outline: none; }
.account-menu-toggle .account-avatar { margin-right: 9px; }
.account-menu-chevron { margin-left: 10px; color: #81908a; font-size: 9px; transition: transform .16s ease; }
.account-menu-toggle[aria-expanded="true"] .account-menu-chevron { transform: rotate(180deg); }
.account-menu { position: absolute; top: calc(100% + 9px); right: 0; z-index: 30; width: 184px; padding: 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); box-shadow: 0 12px 30px rgba(27,55,48,.15); }
.account-menu[hidden] { display: none; }
.account-menu a, .account-menu .signout-button { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font-size: 11px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu .signout-button:hover { background: #f2f4ef; color: var(--navy); }
.account-menu i { width: 15px; color: #947449; text-align: center; }
.account-menu form { margin: 5px 0 0; padding: 5px 0 0; border: 0; border-top: 1px solid var(--line); }
.account-menu .signout-button:hover { color: var(--red); }
.signout-button:hover { color: var(--red); }
.theme-toggle { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; margin-right: 14px; padding: 0 10px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--ink); font-size: 10px; font-weight: 700; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--gold); background: #f6f1e8; outline: none; }
.theme-toggle i { color: #947449; font-size: 12px; }
.login-theme-toggle { position: fixed; top: 20px; right: 20px; z-index: 1; }
.page-content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 36px 38px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: #a1804c; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.page-heading h1 { margin: 0 0 6px; color: var(--navy); font: 700 34px/1.15 "Manrope", Arial, sans-serif; letter-spacing: -.035em; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }

.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid transparent; border-radius: 3px; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.button--primary:hover { border-color: #225051; background: #225051; color: #fff; }
.button--secondary { border-color: #dce2dd; background: #fff; color: var(--navy); }
.button--secondary:hover { background: #f3f6f2; color: var(--navy); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 0 0 20px; }
.stat-card { display: flex; min-height: 120px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 3px 12px rgba(27,55,48,.025); }
.stat-icon { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center; margin-right: 15px; border-radius: 4px; background: #f2f4ef; color: var(--navy); font-size: 20px; }
.stat-icon--posts { background: #f5f0e7; color: #92703b; }
.stat-icon--team { background: #edf4ee; color: #397052; }
.stat-icon--parishes { background: #edf1f5; color: #536d87; }
.stat-card p { margin: 0 0 3px; color: #65736f; font-size: 10px; font-weight: 600; }
.stat-card strong { display: block; color: var(--navy); font: 700 28px/1.2 "Manrope", Arial, sans-serif; }
.stat-card small { display: block; margin-top: 4px; color: #919b96; font-size: 9px; }
.stats-grid--compact .stat-card { min-height: 92px; }
.stats-grid--compact .stat-card strong { font-size: 25px; }

.dashboard-charts { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 18px; margin-bottom: 18px; }
.chart-panel { min-width: 0; margin: 0; }
.chart-panel .panel-heading { min-height: 32px; }
.chart-period { padding: 5px 8px; border-radius: 20px; background: #f6f1e8; color: #947449; font-size: 8px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.chart-canvas { position: relative; width: 100%; }
.chart-canvas--bar { height: 245px; }
.chart-canvas--doughnut { height: 220px; max-width: 300px; margin: 0 auto; }
.chart-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.profile-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.profile-grid > .panel { min-width: 0; margin: 0; }
.profile-details { text-align: center; }
.profile-details .panel-heading { text-align: left; }
.profile-avatar { display: grid; width: 72px; height: 72px; place-items: center; margin: 4px auto 22px; border: 1px solid #e8dcc5; border-radius: 50%; background: #f6f1e8; color: #947449; font: 700 27px "Manrope", Arial, sans-serif; }
.profile-details__list { margin: 0; border-top: 1px solid var(--line); text-align: left; }
.profile-details__list > div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-details__list dt { color: var(--muted); font-size: 10px; font-weight: 600; }
.profile-details__list dd { margin: 0; color: var(--ink); font-size: 10px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.profile-note { margin: 18px 0 0; padding: 11px; border-radius: 3px; background: #f7f8f5; color: var(--muted); font-size: 9px; text-align: left; }
.profile-note i { margin-right: 5px; color: #947449; }
.profile-intro { margin: -4px 0 20px; color: var(--muted); font-size: 11px; }
.profile-password .admin-form { gap: 8px; }
.profile-password .admin-form label { margin-top: 6px; }
.profile-password .form-actions { margin-top: 9px; }
.profile-password .form-actions .button i { margin-right: 8px; }

.panel { margin-bottom: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 3px 12px rgba(27,55,48,.025); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-heading h2 { margin: 0; color: var(--navy); font: 700 17px "Manrope", Arial, sans-serif; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.dashboard-grid .panel { min-width: 0; margin-bottom: 0; }
.text-link { color: var(--navy); font-size: 10px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link span { margin-left: 3px; }
.recent-list { border-top: 1px solid #edf0eb; }
.recent-item { display: flex; min-height: 69px; align-items: center; border-bottom: 1px solid #edf0eb; }
.recent-date { width: 48px; flex: 0 0 48px; color: #947449; font: 700 10px "Manrope", Arial, sans-serif; }
.recent-copy { min-width: 0; flex: 1; padding-right: 12px; }
.recent-copy strong, .recent-copy small { display: block; }
.recent-copy strong { overflow: hidden; color: #304341; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy small { margin-top: 4px; color: #8c9692; font-size: 9px; }
.status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 20px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.status::before { width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status--published { background: #edf6f0; color: var(--green); }
.status--hidden { background: #f3f1ed; color: #8b7357; }
.shortcut-list { border-top: 1px solid #edf0eb; }
.shortcut { display: flex; min-height: 69px; align-items: center; border-bottom: 1px solid #edf0eb; color: var(--ink); text-decoration: none; }
.shortcut:hover .shortcut-arrow { transform: translateX(3px); }
.shortcut-icon { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; margin-right: 11px; border-radius: 4px; background: #f3f4ef; color: var(--navy); font-size: 17px; }
.shortcut > span:nth-child(2) { min-width: 0; flex: 1; }
.shortcut strong, .shortcut small { display: block; }
.shortcut strong { color: var(--navy); font-size: 11px; }
.shortcut small { margin-top: 3px; color: #89938f; font-size: 9px; }
.shortcut-arrow { margin-left: 8px; color: #8d9a94; transition: transform .16s ease; }
.empty-state { margin: 0; padding: 18px; background: #f7f8f5; color: var(--muted); font-size: 11px; }

.admin-form { display: grid; gap: 14px; }
.admin-form > label, .form-row > label { display: block; min-width: 0; margin: 0; color: #43534f; font-size: 10px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-form input:not([type="checkbox"]), .admin-form textarea, .admin-form select { display: block; width: 100%; min-height: 42px; margin-top: 6px; padding: 10px 11px; border: 1px solid #dce2dc; border-radius: 3px; outline: none; background: #fff; color: var(--ink); font-size: 12px; }
.admin-form .password-field input { margin-top: 6px; padding-right: 46px; }
.password-field { position: relative; min-width: 0; }
.password-toggle { position: absolute; top: calc(50% + 3px); right: 7px; display: inline-grid; width: 34px; height: 34px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; border-radius: 3px; background: transparent; color: #64736e; cursor: pointer; }
.password-toggle:hover { background: rgba(23,60,61,.07); color: var(--navy); }
.password-toggle:focus-visible { outline: 2px solid #9c7b4b; outline-offset: 1px; }
.password-toggle i { font-size: 15px; }
.admin-form textarea { min-height: 104px; resize: vertical; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: #9c7b4b; box-shadow: 0 0 0 3px rgba(156,123,75,.12); }
.admin-field { display: block; min-width: 0; color: #43534f; font-size: 10px; font-weight: 700; }
.admin-field > label, .featured-image-upload > label { display: block; color: #43534f; font-size: 9px; font-weight: 700; }
.featured-image-upload[hidden], .featured-image-url-field[hidden] { display: none; }
.featured-image-upload .button { margin-top: 9px; }
.featured-image-status[data-state="error"] { color: #a33a30; }
.record-photo-upload { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: #f7f8f5; }
.record-photo-upload__preview { display: grid; min-height: 170px; place-items: center; overflow: hidden; background: #e8eee9; color: #74817b; }
.record-photo-upload__preview img { width: 100%; height: 190px; object-fit: cover; }
.record-photo-upload__preview img[hidden] { display: none; }
.record-photo-upload__preview span { display: grid; justify-items: center; gap: 8px; padding: 14px; font-size: 10px; text-align: center; }
.record-photo-upload__preview span[hidden] { display: none; }
.record-photo-upload__preview i { color: #87958f; font-size: 25px; }
.record-photo-upload__controls { min-width: 0; }
.record-photo-upload__controls > label { display: block; color: #43534f; font-size: 10px; font-weight: 700; }
.record-photo-upload__controls input[type="file"] { display: block; width: 100%; margin-top: 7px; color: var(--muted); font-size: 10px; }
.record-photo-upload__controls .button { margin-top: 10px; }
.record-photo-status[data-state="error"] { color: #a33a30; }
.post-description-field { min-width: 0; }
.post-description-field > label { display: block; margin: 0; color: #43534f; font-size: 10px; font-weight: 700; }
.post-formatting-toolbar { display: flex; gap: 5px; margin-top: 7px; padding: 6px; border: 1px solid #dce2dc; border-bottom: 0; border-radius: 3px 3px 0 0; background: #f7f8f5; }
.post-formatting-toolbar button { display: grid; width: 30px; height: 28px; place-items: center; border: 1px solid #dce2dc; border-radius: 3px; background: #fff; color: var(--ink); cursor: pointer; font: 13px "DM Sans", Arial, sans-serif; }
.post-formatting-toolbar button:hover, .post-formatting-toolbar button:focus-visible { border-color: #9c7b4b; background: #f3eee5; outline: 2px solid rgba(156,123,75,.25); }
.post-formatting-toolbar__heading select { height: 28px; padding: 0 7px; border: 1px solid #dce2dc; border-radius: 3px; background: #fff; color: var(--ink); font: 10px "DM Sans", Arial, sans-serif; }
.post-formatting-toolbar [data-format-heading] { width: auto; padding: 0 8px; font: 10px "DM Sans", Arial, sans-serif; }
.admin-form .post-description-field textarea { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.post-image-insert { margin-top: 12px; padding: 13px; border: 1px solid #dce2dc; border-radius: 3px; background: #f7f8f5; }
.post-image-insert h3 { margin: 0 0 10px; color: var(--navy); font-size: 11px; }
.post-image-insert__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.post-image-insert__fields label { display: grid; gap: 5px; min-width: 0; color: #43534f; font-size: 9px; font-weight: 700; }
.post-image-insert__fields input, .post-image-insert__fields select, .post-image-insert__fields textarea { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid #dce2dc; border-radius: 3px; background: #fff; color: var(--ink); font: 11px "DM Sans", Arial, sans-serif; }
.post-image-insert__fields textarea { resize: vertical; }
.post-image-insert__fields [hidden] { display: none; }
.post-image-insert__button { margin-top: 10px; }
.post-image-insert__button:disabled { cursor: wait; opacity: .65; }
.post-image-insert__status { margin: 8px 0 0; color: #65716d; font-size: 10px; }
.post-image-insert__status[data-state="error"] { color: #a33a30; }
.post-image-list { display: grid; gap: 8px; margin-top: 12px; }
.post-image-item { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px; border: 1px solid #dce2dc; border-radius: 3px; background: #fff; }
.post-image-item__preview { width: 74px; height: 62px; border-radius: 2px; background: #eceee9; object-fit: cover; }
.post-image-item__details { min-width: 0; }
.post-image-item__details strong { color: var(--navy); font-size: 10px; }
.post-image-item__details p { margin: 3px 0; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.post-image-item__details span { display: block; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.post-image-item__actions { display: flex; gap: 5px; }
.post-image-item__actions button { min-height: 30px; padding: 4px 7px; border: 1px solid #dce2dc; border-radius: 3px; background: #fff; color: var(--navy); font-size: 10px; cursor: pointer; }
.post-image-item__actions button:disabled { cursor: default; opacity: .45; }
.post-image-item__actions button:last-child { color: #a33a30; }
.admin-help { margin: 6px 0 0; color: #89938f; font-size: 9px; font-weight: 400; }
.checkbox-field { display: flex !important; align-items: center; font-weight: 600 !important; }
.checkbox-field input { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: var(--navy); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; }
.form-actions > * { margin-right: 9px; }
.edit-badge, .record-count { padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: #f7f8f5; color: #6d7974; font-size: 9px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.records-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 10px; }
.records-table th, .records-table td { padding: 11px 12px; border-bottom: 1px solid #edf0eb; text-align: left; vertical-align: middle; }
.records-table th { background: #f8f9f6; color: #78837e; font-size: 8px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.records-table tbody tr:hover { background: #fbfcfa; }
.record-image, .image-placeholder { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 3px; background: #edf0eb; object-fit: cover; }
.record-title { min-width: 130px; color: #2f403d; font-weight: 700; }
.record-actions { white-space: nowrap; }
.record-actions a, .record-actions button { padding: 0; border: 0; background: none; color: var(--navy); font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.record-actions a { margin-right: 12px; }
.record-actions a:hover, .record-actions button:hover { text-decoration: underline; }
.record-actions form { display: inline; }
.notice { margin: 0 0 17px; padding: 11px 14px; border: 1px solid #e9dfc9; border-radius: 3px; background: #fbf7ed; color: #675537; font-size: 11px; }
.notice--error { border-color: #efd2ce; background: #fcf0ee; color: #762c25; }
.notice--info { border-color: #c9e0eb; background: #eff8fc; color: #24566a; }

.login-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at top left, #e8eee8, transparent 45%), var(--paper); }
.login-card { width: 100%; max-width: 420px; padding: 36px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: 0 16px 50px rgba(24,55,47,.08); }
.login-brand { display: flex; align-items: center; margin-bottom: 38px; color: var(--navy); text-decoration: none; }
.login-brand .admin-brand-logo { width: 48px; height: 48px; flex-basis: 48px; }
.login-brand strong { font: 800 12px "Manrope", Arial, sans-serif; letter-spacing: .13em; }
.login-brand small { margin-top: 4px; color: #84908b; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.login-card h1 { margin: 0 0 7px; color: var(--navy); font: 700 27px/1.2 "Manrope", Arial, sans-serif; letter-spacing: -.03em; }
.login-intro { margin: 0 0 22px; color: var(--muted); font-size: 11px; }
.login-card .admin-form { margin-top: 20px; }
.login-card .button { width: 100%; margin-top: 3px; }
.login-recovery { display: block; margin-top: 16px; color: var(--navy); font-size: 11px; font-weight: 700; text-align: center; text-decoration: none; }
.login-recovery:hover, .login-recovery:focus-visible { color: #80633b; text-decoration: underline; text-underline-offset: 3px; }
.login-home { display: block; margin-top: 23px; color: #75817c; font-size: 10px; text-align: center; text-decoration: none; }
.login-home:hover { color: var(--navy); }

.loading-overlay[hidden] { display: none; }
.loading-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(16,46,48,.68); backdrop-filter: blur(5px); }
.loading-overlay__card { display: flex; width: min(100%, 340px); flex-direction: column; align-items: center; padding: 34px 28px 30px; border: 1px solid rgba(196,154,88,.35); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(8,28,32,.25); text-align: center; }
.loading-overlay__spinner { position: relative; display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 20px; border: 3px solid #e8eee8; border-top-color: var(--green); border-right-color: #77a68a; border-radius: 50%; animation: loading-overlay-spin .85s linear infinite; }
.loading-overlay__spinner::after { width: 28px; height: 28px; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 7px #fff; content: ""; }
.loading-overlay__card strong { color: var(--navy); font: 700 16px/1.35 "Manrope", Arial, sans-serif; }
.loading-overlay__card > span:last-child { margin-top: 8px; color: var(--muted); font-size: 11px; }
@keyframes loading-overlay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-overlay__spinner { animation-duration: 2s; } }

html[data-admin-theme="dark"] {
  color-scheme: dark;
  --ink: #e2ebe7;
  --navy: #c1ddd4;
  --navy-dark: #0c191a;
  --paper: #141d1c;
  --white: #202b29;
  --muted: #a4b2ad;
  --line: #35433f;
  --green: #83c49a;
  --red: #ff958c;
}
html[data-admin-theme="dark"] body,
html[data-admin-theme="dark"] .admin-main { background: var(--paper); color: var(--ink); }
html[data-admin-theme="dark"] .topbar { background: rgba(27,38,36,.97); }
html[data-admin-theme="dark"] .topbar-title span,
html[data-admin-theme="dark"] .account-name,
html[data-admin-theme="dark"] .stat-card p,
html[data-admin-theme="dark"] .stat-card small,
html[data-admin-theme="dark"] .recent-copy small,
html[data-admin-theme="dark"] .shortcut small,
html[data-admin-theme="dark"] .shortcut-arrow,
html[data-admin-theme="dark"] .admin-help,
html[data-admin-theme="dark"] .post-image-insert__status,
html[data-admin-theme="dark"] .login-brand small,
html[data-admin-theme="dark"] .login-home { color: #a4b2ad; }
html[data-admin-theme="dark"] .panel,
html[data-admin-theme="dark"] .stat-card,
html[data-admin-theme="dark"] .login-card,
html[data-admin-theme="dark"] .records-table,
html[data-admin-theme="dark"] .profile-details__list,
html[data-admin-theme="dark"] .admin-form input:not([type="checkbox"]),
html[data-admin-theme="dark"] .admin-form textarea,
html[data-admin-theme="dark"] .admin-form select,
html[data-admin-theme="dark"] .post-image-insert__fields input,
html[data-admin-theme="dark"] .post-image-insert__fields select,
html[data-admin-theme="dark"] .post-image-insert__fields textarea,
html[data-admin-theme="dark"] .post-image-item,
html[data-admin-theme="dark"] .post-image-item__actions button,
html[data-admin-theme="dark"] .post-formatting-toolbar,
html[data-admin-theme="dark"] .post-formatting-toolbar button { border-color: var(--line); background-color: #202b29; color: var(--ink); }
html[data-admin-theme="dark"] .records-table th { background: #263330; color: #b2c0ba; }
html[data-admin-theme="dark"] .records-table th,
html[data-admin-theme="dark"] .records-table td,
html[data-admin-theme="dark"] .profile-details__list,
html[data-admin-theme="dark"] .profile-details__list > div,
html[data-admin-theme="dark"] .recent-list,
html[data-admin-theme="dark"] .recent-item,
html[data-admin-theme="dark"] .shortcut-list,
html[data-admin-theme="dark"] .shortcut { border-color: #35433f; }
html[data-admin-theme="dark"] .records-table tbody tr:hover,
html[data-admin-theme="dark"] .shortcut:hover { background: #283532; }
html[data-admin-theme="dark"] .record-title,
html[data-admin-theme="dark"] .post-image-item__details p { color: #e2ebe7; }
html[data-admin-theme="dark"] .stat-icon,
html[data-admin-theme="dark"] .shortcut-icon,
html[data-admin-theme="dark"] .empty-state,
html[data-admin-theme="dark"] .profile-note,
html[data-admin-theme="dark"] .edit-badge,
html[data-admin-theme="dark"] .record-count,
html[data-admin-theme="dark"] .post-image-insert,
html[data-admin-theme="dark"] .post-image-insert__fields,
html[data-admin-theme="dark"] .post-formatting-toolbar__heading select { border-color: var(--line); background: #263330; color: var(--ink); }
html[data-admin-theme="dark"] .stat-icon--posts { background: #40382b; color: #e2bd7d; }
html[data-admin-theme="dark"] .stat-icon--team { background: #263b30; color: #8ac99f; }
html[data-admin-theme="dark"] .stat-icon--parishes { background: #2b3642; color: #a7bdd6; }
html[data-admin-theme="dark"] .profile-avatar { border-color: #67583e; background: #39342c; color: #e2bd7d; }
html[data-admin-theme="dark"] .profile-details__list dt { color: #a4b2ad; }
html[data-admin-theme="dark"] .profile-details__list dd { color: #e2ebe7; }
html[data-admin-theme="dark"] .profile-note { background: #263330; }
html[data-admin-theme="dark"] .status--published { background: #263b30; color: #9bd5ad; }
html[data-admin-theme="dark"] .status--hidden { background: #39342c; color: #d3bb94; }
html[data-admin-theme="dark"] .button--primary { border-color: #3e756a; background: #35665e; color: #fff; }
html[data-admin-theme="dark"] .button--primary:hover { border-color: #4a887b; background: #40776c; }
html[data-admin-theme="dark"] .button--secondary { border-color: var(--line); background: #263330; color: #d5e4de; }
html[data-admin-theme="dark"] .button--secondary:hover,
html[data-admin-theme="dark"] .post-formatting-toolbar button:hover { background: #34443f; }
html[data-admin-theme="dark"] .admin-form > label,
html[data-admin-theme="dark"] .form-row > label,
html[data-admin-theme="dark"] .admin-field,
html[data-admin-theme="dark"] .admin-field > label,
html[data-admin-theme="dark"] .featured-image-upload > label,
html[data-admin-theme="dark"] .record-photo-upload__controls > label,
html[data-admin-theme="dark"] .post-description-field > label { color: #d0ddd7; }
html[data-admin-theme="dark"] .record-photo-upload { border-color: var(--line); background: #202b29; }
html[data-admin-theme="dark"] .record-photo-upload__preview { background: #35433f; color: #b4c5bd; }
html[data-admin-theme="dark"] .password-toggle { color: #b4c5bd; }
html[data-admin-theme="dark"] .password-toggle:hover { background: #34443f; color: #e2ebe7; }
html[data-admin-theme="dark"] .post-formatting-toolbar { border-bottom-color: var(--line); }
html[data-admin-theme="dark"] .post-image-item__preview,
html[data-admin-theme="dark"] .record-image,
html[data-admin-theme="dark"] .image-placeholder { background: #35433f; }
html[data-admin-theme="dark"] .notice { border-color: #67583e; background: #332d22; color: #e1cc9f; }
html[data-admin-theme="dark"] .notice--error { border-color: #74433f; background: #382624; color: #ffaaa1; }
html[data-admin-theme="dark"] .notice--info { border-color: #3d5e68; background: #22343a; color: #a9d8e5; }
html[data-admin-theme="dark"] .theme-toggle { border-color: #52615c; color: #e4ece8; }
html[data-admin-theme="dark"] .theme-toggle:hover,
html[data-admin-theme="dark"] .theme-toggle:focus-visible { background: #34443f; }
html[data-admin-theme="dark"] .theme-toggle i { color: #e2bd7d; }
html[data-admin-theme="dark"] .account-menu-toggle:hover,
html[data-admin-theme="dark"] .account-menu-toggle:focus-visible,
html[data-admin-theme="dark"] .account-menu-toggle[aria-expanded="true"] { border-color: var(--line); background: #263330; }
html[data-admin-theme="dark"] .account-menu { border-color: var(--line); background: #202b29; }
html[data-admin-theme="dark"] .account-menu a,
html[data-admin-theme="dark"] .account-menu .signout-button { color: var(--ink); }
html[data-admin-theme="dark"] .account-menu a:hover,
html[data-admin-theme="dark"] .account-menu .signout-button:hover { background: #34443f; color: #e2ebe7; }
html[data-admin-theme="dark"] .account-menu form { border-color: var(--line); }
html[data-admin-theme="dark"] .login-page { background: radial-gradient(circle at top left, #263b35, transparent 45%), var(--paper); }
html[data-admin-theme="dark"] .login-card { box-shadow: 0 16px 50px rgba(0,0,0,.24); }
html[data-admin-theme="dark"] .login-brand,
html[data-admin-theme="dark"] .login-recovery { color: #c1ddd4; }

@media (max-width: 1000px) {
  .sidebar { width: 220px; }
  .admin-main { margin-left: 220px; }
  .topbar { padding-right: 26px; padding-left: 26px; }
  .page-content { padding-right: 26px; padding-left: 26px; }
  .dashboard-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .sidebar { position: fixed; top: 0; right: 0; bottom: auto; left: 0; z-index: 20; width: 100%; min-height: 62px; flex-direction: row; align-items: center; padding: 10px 16px; box-shadow: 0 5px 18px rgba(0,0,0,.17); }
  .sidebar-brand { flex: 1; padding: 0 4px; }
  .sidebar-brand .admin-brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar-toggle { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; background: rgba(255,255,255,.06); color: #fff; cursor: pointer; }
  .sidebar-toggle:hover, .sidebar-toggle:focus-visible { border-color: var(--gold); background: rgba(255,255,255,.12); }
  .sidebar-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  .sidebar-toggle i { font-size: 17px; }
  .sidebar-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; max-height: calc(100dvh - 62px); overflow-y: auto; padding: 10px 16px 16px; border-top: 1px solid rgba(255,255,255,.13); background: var(--navy-dark); box-shadow: 0 14px 22px rgba(0,0,0,.2); }
  .sidebar-nav.is-open { display: grid; }
  .sidebar-link { min-height: 46px; margin: 0; padding: 8px 12px; border: 0; border-left: 3px solid transparent; font-size: 12px; }
  .sidebar-link.is-active { border-left-color: var(--gold); background: rgba(255,255,255,.09); }
  .sidebar-icon { width: 28px; height: 28px; flex-basis: 28px; margin-right: 11px; font-size: 15px; }
  .admin-main { margin-left: 0; padding-top: 122px; }
  .topbar { position: fixed; top: 62px; right: 0; left: 0; z-index: 19; min-height: 60px; gap: 12px; padding: 9px 16px; box-shadow: 0 3px 12px rgba(27,55,48,.06); }
  .topbar-title { min-width: 0; }
  .topbar-title strong { white-space: nowrap; }
  .account-avatar { width: 30px; height: 30px; flex-basis: 30px; margin-right: 7px; }
  .account-name { max-width: 92px; font-size: 10px; }
  .theme-toggle { min-height: 32px; margin-right: 8px; padding: 0 8px; }
  .theme-toggle span { display: none; }
  .account-menu-toggle { min-height: 38px; padding: 3px; }
  .account-menu-toggle .account-avatar { margin-right: 7px; }
  .account-menu-chevron { margin-left: 6px; }
  .account-menu { top: calc(100% + 7px); }
  .page-content { padding: 25px 16px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading > .button { margin-top: 14px; }
  .page-heading h1 { font-size: 30px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 106px; padding: 13px; }
  .stat-icon { width: 34px; height: 34px; flex-basis: 34px; margin-right: 10px; font-size: 17px; }
  .stat-card strong { font-size: 24px; }
  .panel { padding: 17px 14px; }
  .record-photo-upload { grid-template-columns: minmax(0, 1fr); }
  .record-photo-upload__preview { min-height: 210px; }
  .record-photo-upload__preview img { height: 240px; }
}
@media (max-width: 430px) {
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .topbar { gap: 8px; padding-right: 12px; padding-left: 12px; }
  .topbar-title span { font-size: 7px; }
  .topbar-title strong { font-size: 12px; }
  .theme-toggle { margin-right: 5px; }
  .account-menu-toggle { min-height: 36px; padding: 2px; }
  .account-menu-toggle .account-avatar { margin-right: 0; }
  .account-menu-chevron { margin-left: 5px; }
  .account-name { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 82px; }
  .stats-grid--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stats-grid--compact .stat-card { min-height: 76px; padding: 9px; }
  .stats-grid--compact .stat-card strong { font-size: 21px; }
  .stats-grid--compact .stat-card p { font-size: 9px; }
  .form-row { grid-template-columns: 1fr; }
  .post-image-insert__fields { grid-template-columns: 1fr; }
  .post-image-item { grid-template-columns: 58px minmax(0, 1fr); }
  .post-image-item__preview { width: 58px; height: 54px; }
  .post-image-item__actions { grid-column: 2; }
  .recent-item { align-items: flex-start; flex-wrap: wrap; padding: 12px 0; }
  .recent-date { width: 43px; flex-basis: 43px; padding-top: 2px; }
  .recent-copy { flex-basis: calc(100% - 60px); }
  .recent-item .status { margin: 8px 0 0 43px; }
  .login-card { padding: 27px 22px; }
}
