/* ============================================================
   Church — Interactive mini-app (dashboard demo)
   Scoped under .miniapp. Always light, product-accurate.
   ============================================================ */

.miniapp-wrap {
  max-width: 1120px;
  margin: 0 auto;
  position: relative;
}
.miniapp {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-5);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Browser chrome bar */
.miniapp .db-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid #eef2f6;
  background: #f7f9fb;
}
.miniapp .db-top .dots { display: flex; gap: 6px; }
.miniapp .db-top .dots span { width: 11px; height: 11px; border-radius: 50%; background: #dfe6ec; }
.miniapp .db-top .url {
  flex: 1; text-align: center; font-size: 12px; color: #8aa0b2;
  font-family: var(--font-mono);
}
.ma-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ma-badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
  animation: ma-pulse 1.8s ease-in-out infinite;
}
@keyframes ma-pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ---- App shell ---- */
.ma-root {
  --ma-ink: #031C2F;
  --ma-blue: #055A92;
  --ma-blue-soft: #E4EEF5;
  --ma-line: #E6ECF0;
  --ma-muted: #3B5167;
  --ma-muted-2: #6B8197;
  color: var(--ma-ink);
  font-size: 13px;
  background: #fff;
}

.ma-root { }
.ma-fico { width: 16px; height: 16px; flex-shrink: 0; }

/* Top nav */
.ma-nav {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px;
  height: 54px;
  border-bottom: 1px solid var(--ma-line);
  position: relative;
  z-index: 30;
}
.ma-nav-logo {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
}
.ma-nav-logo img { width: 100%; height: 100%; object-fit: contain; }
.ma-nav-items { display: flex; align-items: center; gap: 4px; }
.ma-nav-item {
  appearance: none; border: 0; background: transparent;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ma-ink);
  padding: 7px 12px; border-radius: 8px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: background 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.ma-nav-item:hover { background: #f2f6f9; }
.ma-nav-item.on { background: var(--ma-blue-soft); color: var(--ma-blue); font-weight: 600; }
.ma-nav-item .caret { width: 12px; height: 12px; opacity: .5; }
.ma-nav-search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: #f2f6f9; border-radius: 9px;
  padding: 8px 12px; min-width: 220px;
  color: var(--ma-muted-2); font-size: 12px;
}
.ma-nav-search svg { width: 14px; height: 14px; }
.ma-nav-search .kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10px; opacity: .7; }

/* Body: sidebar + content — FIXED height like a real app viewport */
.ma-body { display: grid; grid-template-columns: 210px 1fr; height: 540px; }
.ma-side {
  border-right: 1px solid var(--ma-line);
  padding: 16px 12px;
  background: #fff;
  overflow-y: auto;
}
.ma-side-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ma-muted-2); padding: 4px 10px 10px;
}
.ma-side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ma-ink);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.ma-side-item:hover { background: #f4f7fa; }
.ma-side-item.on { background: var(--ma-blue-soft); color: var(--ma-blue); font-weight: 600; }
.ma-side-item .ma-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.ma-side-item .ma-fico { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.ma-side-item.on .ma-ico { opacity: 1; }

.ma-content { padding: 24px 28px; overflow-y: auto; }
.ma-h1 {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.ma-h1 .thin { font-weight: 500; }

/* Filter chips */
.ma-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.ma-chip {
  appearance: none; border: 1px solid var(--ma-line); background: #fff;
  font: inherit; font-size: 12px; color: var(--ma-muted);
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 140ms ease;
}
.ma-chip:hover { border-color: #d4dee6; }
.ma-chip.on { background: var(--ma-blue); border-color: var(--ma-blue); color: #fff; font-weight: 600; }
.ma-chip svg { width: 13px; height: 13px; }
.ma-period-note { margin-left: auto; font-size: 12px; color: var(--ma-muted-2); }
.ma-period-note b { color: var(--ma-ink); font-weight: 600; }

/* Card grid */
.ma-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.ma-card {
  border: 1px solid var(--ma-line); border-radius: 16px;
  padding: 18px; background: #fff;
  display: flex; flex-direction: column;
}
.ma-card .ma-card-t { font-size: 12px; color: var(--ma-muted); margin-bottom: 12px; }
.ma-metric { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.ma-sub { font-size: 12px; color: var(--ma-muted); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.ma-sub.up { color: #10a85b; }
.ma-sub.down { color: #d94555; }

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Donut */
.ma-donut { display: flex; align-items: center; gap: 18px; }
.ma-donut svg { width: 92px; height: 92px; flex-shrink: 0; }
.ma-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.ma-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ma-legend-row .dot { width: 9px; height: 9px; border-radius: 50%; }
.ma-legend-row .nm { color: var(--ma-ink); }
.ma-legend-row .vl { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Area chart */
.ma-chart { height: 92px; margin-top: 6px; }
.ma-chart svg { width: 100%; height: 100%; }

/* Bar split */
.ma-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 14px; gap: 3px; }
.ma-bar i { display: block; height: 100%; border-radius: 3px; }
.ma-bar-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ma-muted); }
.ma-bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ma-bar-legend .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Simple list rows (cultos / pagamento) */
.ma-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ma-line); font-size: 12.5px; }
.ma-row:last-child { border-bottom: 0; }
.ma-row .ma-tag { width: 42px; text-align: center; font-size: 10px; font-weight: 600; color: var(--ma-muted); }
.ma-row .ma-tag b { display: block; font-size: 12px; color: var(--ma-ink); }
.ma-row .ma-row-main { flex: 1; }
.ma-row .ma-row-main b { display: block; font-weight: 600; }
.ma-row .ma-row-main span { color: var(--ma-muted); font-size: 11px; }
.ma-row .ma-row-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.ma-row .ma-pico { width: 22px; height: 22px; color: var(--ma-blue); }

.ma-agenda-day { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; }

/* Buttons */
.ma-btn {
  appearance: none; border: 0; font: inherit; cursor: pointer;
  background: var(--ma-blue); color: #fff; font-weight: 600; font-size: 12.5px;
  padding: 9px 15px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: filter 140ms ease, transform 140ms ease;
}
.ma-btn:hover { filter: brightness(1.08); }
.ma-btn:active { transform: translateY(1px); }
.ma-btn svg { width: 14px; height: 14px; }
.ma-btn-ghost { background: #fff; color: var(--ma-ink); border: 1px solid var(--ma-line); }
.ma-btn-ghost:hover { background: #f4f7fa; filter: none; }
.ma-btn-static { cursor: default; }
.ma-btn-static:hover { filter: none; transform: none; }
.ma-btn-static:active { transform: none; }

/* Section head with action */
.ma-shead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

/* Search input */
.ma-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--ma-line); border-radius: 10px;
  padding: 11px 14px; font: inherit; font-size: 13px; color: var(--ma-ink);
  background: #fff;
}
.ma-input::placeholder { color: var(--ma-muted-2); }
.ma-input:focus { outline: none; border-color: var(--ma-blue); }
.ma-field { margin-bottom: 16px; }
.ma-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.ma-field .req { color: #d94555; }
.ma-select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--ma-line);
  border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 13px;
  background: #fff; color: var(--ma-ink); cursor: pointer;
}

/* Plano de contas table */
.ma-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ma-table thead th {
  text-align: left; font-weight: 600; color: var(--ma-muted);
  padding: 10px 8px; border-bottom: 1px solid var(--ma-line);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
}
.ma-table td { padding: 11px 8px; border-bottom: 1px solid var(--ma-line); }
.ma-acct { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.ma-acct .ma-caret {
  width: 14px; height: 14px; color: var(--ma-muted); transition: transform 160ms ease; flex-shrink: 0;
}
.ma-acct.collapsed .ma-caret { transform: rotate(-90deg); }
.ma-acct .ma-fico { width: 16px; height: 16px; color: var(--ma-muted); flex-shrink: 0; }
.ma-acct .ma-code { color: var(--ma-muted-2); font-variant-numeric: tabular-nums; font-size: 11px; min-width: 30px; }
.ma-acct .ma-name { font-weight: 600; }
.ma-acct.child { padding-left: 26px; }
.ma-acct.child .ma-name { font-weight: 500; }
.ma-badge-pill { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.ma-badge-pill.rec { background: #e7f6ee; color: #10a85b; }
.ma-badge-pill.desp { background: #fdeaea; color: #d94555; }
.ma-actions { display: flex; gap: 10px; color: var(--ma-muted-2); }
.ma-actions svg { width: 15px; height: 15px; cursor: pointer; transition: color 140ms ease; }
.ma-actions svg:hover { color: var(--ma-blue); }
tr.ma-hidden { display: none; }

/* Grupos de acesso split */
.ma-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ma-glist { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--ma-line); border-radius: 14px; overflow: hidden; }
.ma-gitem {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; cursor: pointer; border-bottom: 1px solid var(--ma-line);
  transition: background 140ms ease;
}
.ma-gitem:last-child { border-bottom: 0; }
.ma-gitem:hover { background: #f7f9fb; }
.ma-gitem.on { background: var(--ma-blue-soft); }
.ma-gitem b { font-weight: 600; font-size: 13.5px; }
.ma-gitem .chev { width: 16px; height: 16px; color: var(--ma-muted-2); }
.ma-gdetail {
  border: 1px dashed var(--ma-line); border-radius: 14px;
  padding: 24px; display: flex; flex-direction: column;
}
.ma-gdetail.empty { align-items: center; justify-content: center; text-align: center; color: var(--ma-muted); }
.ma-gdetail h4 { margin: 0 0 4px; font-size: 15px; }
.ma-gdetail .ma-perm { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--ma-line); font-size: 12.5px; }
.ma-gdetail .ma-perm:last-child { border-bottom: 0; }
.ma-gdetail .ma-perm svg { width: 15px; height: 15px; color: #10a85b; flex-shrink: 0; }

/* Empty state */
.ma-empty { text-align: center; color: var(--ma-muted-2); padding: 40px 0; font-size: 12.5px; }

/* Enter transition on screen swap */
.ma-fade { animation: ma-fade-in 320ms cubic-bezier(0.16,1,0.3,1); }
@keyframes ma-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ma-fade { animation: none; } }

/* ---- Demo lock overlay ---- */
.ma-body { position: relative; }
.ma-lock {
  position: absolute; inset: 0;
  z-index: 25;
  display: grid; place-items: center;
  padding: 24px;
  background: color-mix(in oklab, #ffffff 34%, transparent);
  backdrop-filter: saturate(120%) blur(9px);
  -webkit-backdrop-filter: saturate(120%) blur(9px);
  animation: ma-lock-in 260ms ease;
}
@keyframes ma-lock-in { from { opacity: 0; } to { opacity: 1; } }
.ma-lock-card {
  background: #fff;
  border: 1px solid var(--ma-line);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(3,28,47,0.20);
  padding: 34px 34px 30px;
  max-width: 400px;
  text-align: center;
  animation: ma-fade-in 320ms cubic-bezier(0.16,1,0.3,1);
}
.ma-lock-badge {
  width: 52px; height: 52px; border-radius: 15px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
}
.ma-lock-badge svg { width: 24px; height: 24px; }
.ma-lock-card h3 { margin: 0 0 8px; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; color: var(--ma-ink); }
.ma-lock-card p { margin: 0 0 22px; font-size: 13.5px; line-height: 1.5; color: var(--ma-muted); }
.ma-lock-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px;
  padding: 13px 22px; border-radius: 999px;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease;
}
.ma-lock-cta svg { width: 15px; height: 15px; transition: transform 160ms ease; }
.ma-lock-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ma-lock-cta:hover svg { transform: translateX(3px); }
.ma-lock-back {
  display: block; margin: 14px auto 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--ma-muted-2);
  text-decoration: underline; text-underline-offset: 3px;
}
.ma-lock-back:hover { color: var(--ma-muted); }

/* Mobile: hide both the interactive shell and the prints carousel —
   a desktop-only notice replaces the whole block (see landing.css) */
.ma-mobile { display: none; }
@media (max-width: 820px) {
  .ma-root, .ma-mobile { display: none !important; }
}

/* ---- Mobile prints carousel (option A) ---- */
.ma-mtrack {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ma-mtrack::-webkit-scrollbar { display: none; }
.ma-mslide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  padding: 16px 16px 8px;
  box-sizing: border-box;
}
.ma-mcap {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ma-blue);
  background: var(--ma-blue-soft); border-radius: 999px;
  padding: 7px 13px; margin-bottom: 12px;
}
.ma-mcap-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ma-mshotbox {
  border: 1px solid var(--ma-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(3,28,47,0.10);
  background: #fff;
  pointer-events: none;               /* it's a print, not interactive */
}
.ma-shot { overflow: hidden; }
.ma-shot .ma-body { height: 460px; }   /* clip like a screenshot */

.ma-mfoot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 16px 4px;
}
.ma-mdots { display: flex; gap: 7px; }
.ma-mdot {
  width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0;
  background: #cdd8e0; cursor: pointer; transition: background 180ms ease, transform 180ms ease;
}
.ma-mdot.on { background: var(--accent); transform: scale(1.25); }
.ma-mcta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 12px 18px; border-radius: 999px; text-decoration: none;
  white-space: nowrap;
}
.ma-mcta svg { width: 15px; height: 15px; }

/* Existing collapse rules for the (hidden) interactive shell kept harmless */

/* ---- Top-nav dropdown mega-menu ---- */
.ma-nav-wrap { position: relative; }
.ma-nav-item.menu-open { background: var(--ma-blue-soft); color: var(--ma-blue); }
.ma-menu {
  position: absolute; top: calc(100% + 10px); left: 0;
  background: #fff; border: 1px solid var(--ma-line);
  border-radius: 16px; box-shadow: 0 20px 50px rgba(11,31,48,0.16);
  padding: 12px; z-index: 50;
  display: grid; grid-template-columns: 1fr; gap: 2px;
  width: 380px;
  animation: ma-menu-in 200ms cubic-bezier(0.16,1,0.3,1);
}
.ma-menu.wide { grid-template-columns: 1fr 1fr; width: 680px; column-gap: 8px; }
@keyframes ma-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ma-menu-item {
  appearance: none; border: 0; background: transparent; text-align: left;
  font: inherit; cursor: pointer;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 13px; border-radius: 11px;
  transition: background 140ms ease;
}
.ma-menu-item:hover { background: #f4f7fa; }
.ma-menu-item > .ma-ico { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--ma-ink); }
.ma-menu-item > .ma-fico { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--ma-ink); }
.ma-menu-tx { flex: 1; min-width: 0; }
.ma-menu-tx b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ma-ink); margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.ma-menu-tx span { display: block; font-size: 11.5px; color: var(--ma-muted); line-height: 1.4; }
.ma-menu-item > .chev { width: 15px; height: 15px; color: var(--ma-muted-2); flex-shrink: 0; align-self: center; }
.ma-beta { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--accent); color: #fff; padding: 2px 6px; border-radius: 999px; }

/* ---- Aniversariantes avatars ---- */
.ma-av { width: 26px; height: 26px; border-radius: 50%; background: #eaf3fa; color: #0b63a5; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.ma-av.more { background: #f2f6f9; color: #6b8296; font-size: 10px; }

/* ---- Favorites customization ---- */
.ma-side-item.static { cursor: default; }
.ma-side-item.static:hover { background: transparent; }
.ma-fav-btn {
  margin-left: auto; appearance: none; background: transparent; border: 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid currentColor;
}
.ma-fav-btn svg { width: 13px; height: 13px; }
.ma-fav-btn.rem { color: var(--accent); }
.ma-fav-btn.add { color: var(--ma-blue); }
.ma-fav-search {
  display: flex; align-items: center; gap: 8px;
  background: #f2f6f9; border-radius: 9px; padding: 9px 12px;
  color: var(--ma-muted-2); font-size: 12px; margin: 12px 4px;
}
.ma-fav-search svg { width: 14px; height: 14px; }
.ma-fav-done, .ma-fav-personalize {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; margin-top: 8px;
  border-top: 1px solid var(--ma-line);
  color: var(--ma-muted); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.ma-fav-done { color: var(--ma-blue); }
.ma-fav-done svg, .ma-fav-personalize svg { width: 16px; height: 16px; }
.ma-fav-personalize:hover { color: var(--ma-ink); }
