:root {
  --bg: #f3f6fa;
  --bg-accent: #e3edf4;
  --surface: #ffffff;
  --surface-alt: #f0f5f9;
  --surface-strong: #10294c;
  --text: #172c45;
  --muted: #617185;
  --border: rgba(18, 49, 94, 0.16);
  --shadow: 0 20px 45px rgba(18, 49, 94, 0.12);
  --brand: #12315e;
  --brand-dark: #0d2446;
  --accent: #c19a4a;
  --success: #146c43;
  --warning: #a55b00;
  --danger: #c13333;
  --info: #2457b8;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(204, 139, 47, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(18, 49, 94, 0.18), transparent 30%),
    linear-gradient(180deg, #fbf6ef 0%, #f2ece4 100%);
}

body.auth-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff url('../assets/church-logo-original.png') center calc(50% - 35px) / min(76vw, 470px) auto no-repeat;
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 999;
}

body.auth-loading::after {
  content: "";
  position: fixed;
  left: calc(50% - 13px);
  top: calc(50% + 100px);
  width: 26px;
  height: 26px;
  border: 2px solid #e6eafa;
  border-top-color: #304bb4;
  border-radius: 50%;
  z-index: 1000;
  animation: sojj-spin .9s linear infinite;
}
@media (prefers-reduced-motion: reduce) { body.auth-loading::after { animation: none; } }

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(18, 49, 94, 0.48);
  box-shadow: 0 0 0 4px rgba(18, 49, 94, 0.08);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.2rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.muted-text,
.panel-meta,
.detail-meta,
.login-footnote {
  color: var(--muted);
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: none;
  padding: 0.95rem 1.3rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #244e7d 100%);
  box-shadow: 0 16px 25px rgba(18, 49, 94, 0.22);
}

.secondary-action {
  color: var(--brand);
  background: rgba(18, 49, 94, 0.08);
}

.ghost-action {
  color: var(--text);
  background: rgba(36, 26, 22, 0.05);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover {
  transform: translateY(-1px);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.app-shell.shell-ready {
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  padding: 2rem 1.25rem;
  background: linear-gradient(180deg, rgba(37, 27, 21, 0.96) 0%, rgba(63, 31, 24, 0.97) 100%);
  color: #fff2ea;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.brand-block h2,
.brand-block p {
  margin: 0;
}

.brand-block p {
  margin-top: 0.65rem;
  color: rgba(255, 242, 234, 0.72);
}

.sidebar-nav {
  display: grid;
  gap: 0.55rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mobile-nav-toggle {
  display: none;
}

.nav-link {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  color: rgba(255, 242, 234, 0.82);
  transition: background 160ms ease, color 160ms ease;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-footer {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-footer strong,
.sidebar-footer span {
  display: block;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 2rem 0;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.page-content {
  padding: 1.8rem 2.2rem 2.4rem;
  display: grid;
  gap: 1.6rem;
  align-content: start;
  width: 100%;
  min-width: 0;
}

.panel,
.hero-panel,
.metric-card,
.card,
.login-card,
.login-brand-panel,
.splash-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel,
.hero-panel,
.login-card,
.login-brand-panel,
.splash-card {
  padding: 1.55rem;
}

.hero-panel {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.4rem;
  width: 100%;
}

.dashboard-hero {
  align-items: stretch;
  background:
    radial-gradient(circle at top right, rgba(204, 139, 47, 0.12), transparent 26%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 246, 236, 0.94) 100%);
}

.hero-copy {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-copy p {
  margin: 0;
  max-width: 680px;
  font-size: 1.05rem;
  color: var(--muted);
}

.executive-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 1rem;
  min-width: min(100%, 420px);
}

.hero-metrics,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.9rem;
}

.metric-card {
  min-width: 170px;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(242,247,251,0.9) 100%);
}

.metric-card h3,
.panel h2,
.card h3,
.login-card h2,
.detail-header h1 {
  margin: 0;
}

.metric-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.95rem;
}

.grid-layout {
  display: grid;
  gap: 1.4rem;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spotlight-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.admin-grid,
.reports-grid,
.person-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.2rem;
  display: grid;
  gap: 0.8rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 35px rgba(69, 44, 33, 0.15);
}

.card-topline,
.card-actions,
.detail-header,
.timeline-item,
.note-item,
.quick-editor,
.user-table-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.card-meta {
  display: grid;
  gap: 0.35rem;
}

.prayer-highlight {
  padding: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(193, 51, 51, 0.2);
  background: rgba(193, 51, 51, 0.08);
  color: #6e1717;
}

.response-highlight {
  padding: 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(36, 87, 184, 0.16);
  background: rgba(36, 87, 184, 0.07);
  color: #1f4692;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-warning {
  color: #7a4300;
  background: rgba(165, 91, 0, 0.12);
}

.status-info {
  color: #1f4692;
  background: rgba(36, 87, 184, 0.12);
}

.status-danger {
  color: #8d1a1a;
  background: rgba(193, 51, 51, 0.12);
}

.status-accent {
  color: #965400;
  background: rgba(204, 139, 47, 0.16);
}

.status-success {
  color: #0f5b37;
  background: rgba(20, 108, 67, 0.12);
}

.status-muted {
  color: #5d534e;
  background: rgba(36, 26, 22, 0.08);
}

.stack-list,
.timeline-list {
  display: grid;
  gap: 0.85rem;
}

.stack-item,
.timeline-item,
.note-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(247, 250, 253, 0.92);
  border: 1px solid rgba(18, 49, 94, 0.1);
}

.timeline-list .timeline-item,
.note-item {
  flex-direction: column;
  align-items: stretch;
}

.compact-stack .directory-person-card {
  margin: 0;
}

.directory-person-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(247, 250, 253, 0.92);
  border: 1px solid rgba(18, 49, 94, 0.1);
}

.directory-person-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.directory-person-meta {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.status-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.summary-pill {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid rgba(18, 49, 94, 0.1);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 1rem;
  align-items: start;
  overflow-x: auto;
}

.kanban-column {
  display: grid;
  gap: 0.9rem;
  min-width: 250px;
  padding: 1rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.kanban-column-header h2 {
  margin: 0;
  font-size: 1rem;
}

.kanban-column-header span {
  min-width: 2rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  text-align: center;
  background: rgba(18, 49, 94, 0.1);
  color: var(--brand);
  font-weight: 800;
}

.kanban-dropzone {
  display: grid;
  gap: 0.85rem;
  min-height: 220px;
}

.kanban-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 49, 94, 0.12);
  background: rgba(247, 250, 253, 0.96);
  box-shadow: 0 12px 25px rgba(18, 49, 94, 0.08);
}

.filter-panel {
  position: sticky;
  top: 0.8rem;
  z-index: 2;
  backdrop-filter: blur(12px);
}

.page-content > * {
  animation: rise-in 320ms ease both;
}

.detail-header {
  padding: 1.2rem 1.4rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.detail-item {
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(242, 247, 251, 0.7);
}

.detail-item span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.prayer-box {
  min-height: 180px;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(193, 51, 51, 0.35);
  background: linear-gradient(180deg, rgba(193, 51, 51, 0.09) 0%, rgba(255, 244, 244, 0.9) 100%);
  white-space: pre-wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.full-width {
  grid-column: 1 / -1;
}

.stack-form {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.inline-alert {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(36, 87, 184, 0.16);
  background: rgba(36, 87, 184, 0.08);
}

.inline-alert.success {
  background: rgba(20, 108, 67, 0.08);
  border-color: rgba(20, 108, 67, 0.16);
}

.inline-alert.error {
  background: rgba(193, 51, 51, 0.08);
  border-color: rgba(193, 51, 51, 0.16);
}

.table-card {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(18, 49, 94, 0.12);
}

.table-header,
.table-row,
.user-table-row,
.access-table-header,
.access-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  align-items: center;
}

.access-table-header,
.access-table-row {
  grid-template-columns: minmax(0, 1.4fr) 0.8fr 1.2fr 1fr 1fr 1fr;
}

.table-header {
  background: rgba(37, 27, 21, 0.06);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.access-table-header {
  background: rgba(37, 27, 21, 0.06);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-row:nth-child(even),
.user-table-row:nth-child(even),
.access-table-row:nth-child(even) {
  background: rgba(242, 247, 251, 0.58);
}

.quick-editor {
  flex-wrap: wrap;
  align-items: end;
}

.empty-state {
  padding: 2rem;
  border: 2px dashed rgba(18, 49, 94, 0.2);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

.auth-problem {
  max-width: 760px;
  margin: 4rem auto;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

.login-body,
.splash-body,
.public-page-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-layout {
  width: min(1140px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  gap: 1.4rem;
}

.login-brand-panel {
  background:
    linear-gradient(160deg, rgba(37, 27, 21, 0.94) 0%, rgba(95, 15, 38, 0.92) 100%),
    url("https://images.unsplash.com/photo-1519491050282-cf00c82424b4?auto=format&fit=crop&w=1400&q=80") center/cover;
  color: #fff6ef;
  min-height: 560px;
}

.login-brand-panel .feature-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.4rem 0 0;
  padding-left: 1.1rem;
}

.login-card {
  align-self: center;
}

.splash-card {
  width: min(560px, 100%);
  text-align: center;
}

.public-page-layout {
  width: min(1120px, 100%);
  display: grid;
  gap: 1.4rem;
}

.public-hero {
  align-items: center;
}

.loading-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(36, 26, 22, 0.08);
  overflow: hidden;
  margin-top: 1.2rem;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%);
  animation: progress 1.2s ease-in-out infinite;
}

@keyframes progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(310%); }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell,
  .login-layout,
  .spotlight-grid,
  .dashboard-grid,
  .admin-grid,
  .reports-grid,
  .person-grid {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .toolbar,
  .form-grid,
  .status-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .topbar,
  .detail-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-metrics,
  .hero-actions {
    justify-content: start;
  }

  .executive-summary {
    grid-template-columns: 1fr;
  }

  .table-header,
  .table-row,
  .user-table-row,
  .access-table-header,
  .access-table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-content,
  .topbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared church identity: navy, sky blue, gold and white. */
:root { --shadow: 0 5px 22px rgba(18,49,94,.045); --radius-xl: 16px; --radius-lg: 12px; --radius-md: 10px; --radius-sm: 8px; }
body { font-family: 'Poppins', sans-serif; background: #f3f6fa; font-size: 14px; line-height: 1.6; }
h1,h2,h3 { font-family: 'Montserrat',sans-serif; line-height: 1.2; }
button:disabled { opacity: .55; cursor: wait; }
a:focus-visible, button:focus-visible { outline: 3px solid #75aac6; outline-offset: 4px; }
.church-logo { width: 188px; height: auto; display: block; }
.app-shell.shell-ready { grid-template-columns: 248px minmax(0,1fr); }
.sidebar { background: #10294c; display:flex; flex-direction:column; padding: 30px 18px; color:#fff; }
.brand-block { background: none; border: 0; padding: 5px 12px 30px; border-bottom: 1px solid #ffffff20; border-radius:0; }
.brand-block .eyebrow { color: #a7c9de; font-size:10px; margin-top:30px; }
.brand-block p { font-size:12px; color:#a7bed4; }
.sidebar-footer { margin-top:auto; font-size:12px; overflow-wrap:anywhere; }
.sidebar-footer .muted-text { color:#b6c9dd; }
.nav-link { font-size:13px; font-weight:500; border-radius:8px; }
.nav-link.active { background:#ffffff14; box-shadow:inset 3px 0 #f3d38b; }
.topbar { background:#fff; padding:22px 32px; border-bottom:1px solid var(--border); }
.topbar h1 { font-size:21px; }
.topbar .eyebrow { font-size:9px; color:var(--muted); }
.eyebrow { font-size:10px; letter-spacing:.18em; }
.panel h2 { font-size:17px; }
.panel-heading { align-items:start; flex-wrap:wrap; gap:8px; }
.panel-meta { font-size:11px; }
.page-content { padding:28px 32px; gap:22px; }
.dashboard-hero { flex-direction:column; background:#fff; position:relative; overflow:hidden; padding:32px; border-top:3px solid #75aac6; }
.hero-copy h1 { font-size:clamp(28px,3vw,40px); line-height:1.15; letter-spacing:-.035em; }
.hero-copy p { font-size:13px; max-width:520px; }
.hero-actions { justify-content:flex-start; }
.executive-summary { grid-template-columns:repeat(4,minmax(0,1fr)); min-width:0; margin-top:12px; }
.metric-card { min-width:0; background:#f4f7fb; border:0; box-shadow:none; border-radius:8px; }
.metric-card .muted-text { font-size:11px; }
.metric-card strong { font-size:30px; color:#12315e; }
.primary-action { background:#12315e; box-shadow:none; border-radius:8px; font-size:12px; }
.primary-action:hover { background:#214a78; }
.secondary-action,.ghost-action { border-radius:8px; font-size:12px; }
.secondary-action { background:#eaf1f7; }
.status-badge { font-size:10px; white-space:normal; }
.summary-pill { background:#f5f8fb; }
.summary-pill strong { font-family:'Montserrat',sans-serif; font-size:22px; }
.stack-item,.directory-person-card,.timeline-item,.note-item { background:#f8fafc; border-color:#e6edf3; }
.stack-item strong { font-size:13px; }
.card { cursor:pointer; }
.card,.detail-item,.prayer-highlight,.stack-item { overflow-wrap:anywhere; }
.card h3 { font-size:17px; }
.card-meta { font-size:12px; }
.prayer-highlight { font-size:12px; margin-top:8px; }
.connection-status { color:#42647e; font-size:11px; }
.connection-status::before { content:''; width:6px; height:6px; border-radius:50%; display:inline-block; background:#75aac6; margin-right:6px; }
.session-table-wrap { overflow-x:auto; }
.session-table { width:100%; border-collapse:collapse; font-size:12px; min-width:720px; }
.session-table th { text-align:left; background:#f0f5f9; font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
.session-table th,.session-table td { padding:14px 12px; border-bottom:1px solid #e6edf3; vertical-align:top; }
.session-table small { display:block; color:var(--muted); margin-top:5px; }
.session-table details { max-width:230px; overflow-wrap:anywhere; }
.session-table summary { color:var(--brand); cursor:pointer; }
.login-body { padding:0; background:#fff; }
.login-layout { width:100%; min-height:100vh; grid-template-columns:1.05fr 1fr; gap:0; }
.login-brand-panel { border:0; border-radius:0; box-shadow:none; min-height:100vh; padding:48px 60px 30px; display:flex; flex-direction:column; background:linear-gradient(180deg,rgba(6,22,43,.7),rgba(6,22,43,.93)),url('../assets/church-worship.jpeg') center/cover; }
.login-brand-copy { margin:auto 0; padding:70px 0; }
.login-brand-copy .eyebrow { color:#b9d3e4; }
.login-brand-copy h1 { margin:24px 0; font-size:clamp(44px,5.8vw,82px); font-weight:800; letter-spacing:-.045em; line-height:1.03; color:#fff; }
.login-brand-copy h1 span { color:#f3d38b; }
.login-brand-copy p { color:#d7e1eb; font-size:15px; line-height:1.8; }
.church-motto { text-transform:uppercase; letter-spacing:.1em; font-size:9px; color:#e9e8de; }
.login-card { max-width:470px; width:100%; justify-self:center; padding:45px; border:0; border-radius:0; box-shadow:none; background:#fff; }
.back-to-church { color:var(--muted); font-size:11px; display:block; margin-bottom:60px; }
.login-heading h2 { font-size:34px; letter-spacing:-.04em; margin:14px 0 10px; }
.login-heading p { color:var(--muted); font-size:13px; margin-bottom:30px; }
.login-card label { font-size:12px; font-weight:500; }
.login-card input { background:#f8fafc; border:1px solid #d9e2eb; font-size:13px; padding:14px; }
.login-card .primary-action { width:100%; justify-content:space-between; padding:16px 20px; margin-top:10px; }
.password-input { display:flex; position:relative; }
.password-input input { padding-right:65px; }
.password-input button { position:absolute; right:12px; top:22px; border:0; background:none; color:var(--brand); font-size:11px; padding:3px; }
.login-footnote { font-size:11px; line-height:1.8; margin:24px 0; }
.login-privacy { border-top:1px solid #e3eaf0; padding-top:20px; color:#617185; font-size:10px; }
@media(max-width:1180px) { .executive-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:980px) {
 .app-shell.shell-ready { grid-template-columns:1fr; }
 .sidebar { position:sticky; top:0; z-index:50; height:auto; padding:12px 16px; border-right:0; box-shadow:0 6px 18px rgba(7,25,49,.18); }
 .brand-block { padding:0; margin:0 0 15px; border:0; }
 .brand-block .church-logo { width:145px; }
 .brand-block .eyebrow,.brand-block p,.sidebar-footer { display:none; }
 .mobile-nav-toggle { display:inline-flex; align-items:center; gap:7px; min-height:42px; padding:8px 12px; border:1px solid #ffffff33; border-radius:8px; background:#ffffff12; color:#fff; font-weight:700; }
 .mobile-nav-toggle span:first-child { font-size:20px; line-height:1; }
 .sidebar-nav { display:none; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-top:10px; border-top:1px solid #ffffff20; }
 .sidebar.menu-open .sidebar-nav { display:grid; }
 .nav-link { white-space:normal; padding:11px 10px; font-size:11px; min-height:44px; display:flex; align-items:center; }
 .topbar { flex-direction:row; padding:18px 20px; }
 .login-brand-panel { padding:40px 28px; }
 .login-card { padding:36px 28px; }
 .login-brand-copy h1 { font-size:54px; }
 .panel-heading { display:block; }
 .panel-meta { display:block; margin-top:8px; }
}
@media(max-width:640px) {
 .login-layout { display:block; }
 .login-layout,.login-brand-panel,.login-card { width:100%; min-width:0; }
 .login-brand-panel { min-height:0; padding:22px 20px; }
 .login-brand-panel .church-logo { width:150px; }
 .login-brand-copy { padding:32px 0 6px; }
 .login-brand-copy h1 { font-size:40px; }
 .login-brand-copy h1 br { display:block; }
 .login-brand-copy p,.church-motto { display:none; }
 .login-card { max-width:none; padding:28px 20px 36px; }
 .back-to-church { margin-bottom:30px; }
 .page-content { padding:18px 14px; }
 .dashboard-hero { padding:22px; }
 .executive-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .topbar h1 { font-size:17px; }
 .connection-status { display:none; }
 .hero-copy h1 { font-size:28px; }
 .topbar { flex-direction:column; align-items:stretch; padding:15px 14px; gap:10px; }
 .topbar-actions { justify-content:space-between; width:100%; }
 .panel,.hero-panel,.detail-header { padding:16px; border-radius:12px; }
 .card-topline,.card-actions,.directory-person-top,.quick-editor,.detail-actions { flex-wrap:wrap; }
 .hero-actions,.detail-actions { width:100%; }
 .hero-actions > a,.hero-actions > button,.detail-actions > a,.detail-actions > button { width:100%; min-height:44px; }
 .stack-form > .primary-action,.form-grid > .primary-action,.form-grid > .secondary-action { width:100%; min-height:46px; }
 input,select,textarea,.login-card input { font-size:16px; }
 button,.primary-action,.secondary-action,.ghost-action { min-height:44px; }
 .login-heading h2 { font-size:28px; }
 .eyebrow { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
 h1,h2,h3,p,.panel-meta { overflow-wrap:anywhere; }
 .public-page-body { padding:12px; }
 .public-hero { align-items:stretch; }
 .filter-panel { position:static; }

 .table-header { display:none; }
 .table-card { overflow:visible; border:0; gap:12px; }
 .table-row { padding:14px; border:1px solid var(--border); border-radius:10px; background:#fff; gap:8px; }
 .table-row > div { display:block; padding:5px 0; }
 .table-row > div::before { display:block; margin-bottom:3px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
 .table-row > div:nth-child(1)::before { content:'Name'; }
 .table-row > div:nth-child(2)::before { content:'Residence'; }
 .table-row > div:nth-child(3)::before { content:'Status'; }
 .table-row > div:nth-child(4)::before { content:'Assigned'; }

 .session-table-wrap,.attendance-table-wrap { overflow:visible; }
 .session-table,.attendance-table { min-width:0; width:100%; display:block; }
 .session-table thead,.attendance-table thead { display:none; }
 .session-table tbody,.attendance-table tbody { display:grid; gap:12px; }
 .session-table tr,.attendance-table tr { display:grid; padding:12px; border:1px solid var(--border); border-radius:10px; background:#fff; }
 .session-table td,.attendance-table td { display:block; padding:9px 4px; border-bottom:1px solid #e6edf3; overflow-wrap:anywhere; }
 .session-table td:last-child,.attendance-table td:last-child { border-bottom:0; }
 .session-table td::before,.attendance-table td::before { display:block; margin-bottom:3px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
 .session-table td:nth-child(1)::before { content:'Staff member'; }
 .session-table td:nth-child(2)::before { content:'Signed in'; }
 .session-table td:nth-child(3)::before { content:'Location & device'; }
 .session-table td:nth-child(4)::before { content:'Duration'; }
 .session-table td:nth-child(5)::before { content:'State'; }
 .attendance-table td:nth-child(1)::before { content:'Date'; }
 .attendance-table td:nth-child(2)::before { content:'Service'; }
 .attendance-table td:nth-child(3)::before { content:'Men'; }
 .attendance-table td:nth-child(4)::before { content:'Women'; }
 .attendance-table td:nth-child(5)::before { content:'Teens'; }
 .attendance-table td:nth-child(6)::before { content:'Children'; }
 .attendance-table td:nth-child(7)::before { content:'Total'; }
 .attendance-table td:nth-child(8)::before { content:'Action'; }
 .attendance-table td .secondary-action { width:100%; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.preview-notice { position:sticky; top:0; z-index:1000; background:#f3d38b; color:#12315e; padding:8px 15px; text-align:center; font-size:10px; font-weight:700; }
.kanban-board { grid-template-columns:repeat(8,minmax(230px,1fr)); }
@media(max-width:980px) { .kanban-board { grid-template-columns:1fr; } }
.page-content { grid-template-columns:minmax(0,1fr); }
.page-content > *, .grid-layout > *, .hero-copy { min-width:0; }

/* Service reporting keeps numeric comparisons readable on phones and desktops. */
.attendance-table-wrap { overflow-x:auto; }
.attendance-table { width:100%; text-align:left; border-collapse:collapse; min-width:720px; }
.attendance-table th,.attendance-table td { padding:14px 12px; border-bottom:1px solid #dce5ee; }
.attendance-table th { background:#edf3fa; color:#123458; }
.attendance-table tbody tr:nth-child(even) { background:#f7f9fc; }
.attendance-bar { margin:16px 0; }
.attendance-bar meter { display:block; width:100%; height:24px; }
.staff-toggle { display:flex; align-items:center; gap:12px; margin:14px 0; }
.staff-toggle input { width:auto; }
#journeyPeople a { display:inline-block; margin:4px 10px 8px 0; }
#careQueue .note-item { margin-top:18px; }
#journeyTimeline .note-item { border-left:3px solid #3155ba; padding-left:18px; }

@media(max-width:640px) {
  .attendance-table-wrap { overflow:visible; }
  .attendance-table { min-width:0; }
}

@media (min-width:981px) {
  .sidebar { height:100dvh; min-height:0; overflow:hidden; }
  .sidebar .brand-block { flex:0 0 auto; padding-bottom:16px; margin-bottom:12px; }
  .sidebar-nav { flex:1 1 auto; min-height:0; overflow-y:auto; align-content:start; scrollbar-width:thin; padding-bottom:12px; }
  .sidebar-footer { flex:0 0 auto; margin-top:12px; }
}
