/* ==========================================================================
   Projeto na Igreja — mobile first
   ========================================================================== */

:root {
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #faf9fe;
  --text: #1c1a2e;
  --muted: #6c6985;
  --border: #e6e3f0;

  --primary: #5b3fd9;
  --primary-600: #4b31c2;
  --primary-50: #efebff;
  --primary-100: #ded6ff;
  --accent: #f2a516;

  --success: #138a4b;
  --success-50: #e5f7ed;
  --warning: #b8670a;
  --warning-50: #fff3e0;
  --danger: #cc2b2b;
  --danger-50: #fdeaea;
  --info: #2f5fd6;
  --info-50: #e8efff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 26, 46, .05), 0 6px 20px rgba(28, 26, 46, .06);
  --shadow-lg: 0 10px 40px rgba(28, 26, 46, .18);

  --topbar-h: 60px;
  --bottomnav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12111a;
    --surface: #1c1a28;
    --surface-2: #232133;
    --text: #eeecf8;
    --muted: #a19db8;
    --border: #2f2c42;
    --primary: #8c74ff;
    --primary-600: #7a60f5;
    --primary-50: #29224d;
    --primary-100: #3a3070;
    --success: #4fd08b;
    --success-50: #173426;
    --warning: #f3b35a;
    --warning-50: #3a2a14;
    --danger: #ff7b7b;
    --danger-50: #3d1d22;
    --info: #86a8ff;
    --info-50: #1d2a4a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}

body.sem-nav { padding-bottom: 0; }

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.text-sm { font-size: .85rem; }
.text-lg { font-size: 1.15rem; }
.fw-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.pre-line { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Layout */

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; color: var(--text); font-size: 1.02rem; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #9b5cf6);
  color: #fff; font-size: 1.05rem;
}
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); line-height: 1; }

.topbar .spacer { flex: 1; }
.topbar-nav { display: none; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-50); color: var(--primary);
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }

/* Menu do usuário (avatar) */
.menu-usuario { position: relative; }
.avatar-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; transition: box-shadow .15s; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--primary-100); }
.menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  min-width: 240px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.menu-dropdown.aberto { opacity: 1; transform: none; pointer-events: auto; }
.menu-cabecalho { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-cabecalho strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-cabecalho small { display: block; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-dropdown a, .menu-dropdown .menu-sair {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .7rem .75rem; border-radius: 10px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: .92rem; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-dropdown a i, .menu-dropdown .menu-sair i { font-size: 1.05rem; color: var(--muted); width: 20px; text-align: center; }
.menu-dropdown a:hover, .menu-dropdown .menu-sair:hover { background: var(--surface-2); }
.menu-dropdown .menu-sair, .menu-dropdown .menu-sair i { color: var(--danger); }
.menu-separador { height: 1px; background: var(--border); margin: 6px 4px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px; }
.container-narrow { max-width: 640px; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header .sub { color: var(--muted); margin-top: .15rem; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-weight: 500; margin-bottom: .5rem; font-size: .9rem; }

/* Bottom navigation (mobile) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .7rem; font-weight: 600;
}
.bottom-nav a i { font-size: 1.35rem; line-height: 1; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active i { transform: translateY(-1px); }

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .topbar { height: 68px; padding: 0 28px; }
  .topbar-nav { display: flex; gap: .25rem; margin-left: 1.5rem; }
  .topbar-nav a {
    display: flex; align-items: center; gap: .45rem;
    padding: .5rem .85rem; border-radius: 999px;
    color: var(--muted); font-weight: 600; font-size: .92rem;
  }
  .topbar-nav a:hover { background: var(--surface-2); color: var(--text); }
  .topbar-nav a.active { background: var(--primary-50); color: var(--primary); }
  .container { padding: 28px; }
  h1 { font-size: 1.8rem; }
}

/* ---------------------------------------------------------------- Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 1rem; }
.card-body { padding: 16px; }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-header h3 { margin: 0; }
.card-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.card-link { display: block; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.card-link:active { transform: scale(.99); }
@media (hover: hover) { .card-link:hover { box-shadow: var(--shadow-lg); } }

.grid { display: grid; gap: 1rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .layout-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .sticky-side { position: sticky; top: 88px; }
}

/* Project card */
.projeto-capa {
  aspect-ratio: 16 / 9; width: 100%; object-fit: cover;
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
}
.projeto-capa-vazia { display: grid; place-items: center; color: var(--primary); font-size: 2.6rem; }
.projeto-card .card-body { display: flex; flex-direction: column; gap: .6rem; }
.projeto-card h3 { margin: 0; }
.projeto-card .resumo { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.igreja-tag { font-size: .75rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .3rem; }

/* Stats */
.stat { padding: 16px; }
.stat .label { color: var(--muted); font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.stat .value { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; margin-top: .15rem; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 960px) { .stat-row.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.hero {
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #9b5cf6 0%, var(--primary) 45%, #3b2a9a 100%);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.hero h1 { color: #fff; margin-bottom: .25rem; }
.hero p { color: rgba(255,255,255,.85); margin: 0; }
.hero .hero-valor { font-size: 1.7rem; font-weight: 800; margin-top: .75rem; letter-spacing: -.02em; }

/* Progress */
.progress { height: 10px; border-radius: 999px; background: var(--primary-50); overflow: hidden; position: relative; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #9b5cf6); transition: width .6s ease; }
.progress-compromisso { position: absolute; inset: 0 auto 0 0; background: var(--primary-100); border-radius: 999px; }
.progress-bar.sucesso { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-info { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .85rem; margin-top: .4rem; }
.progress-info strong { font-size: 1rem; }
.progress-lg { height: 14px; }

/* ---------------------------------------------------------------- Badges */

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-primary { background: var(--primary-50); color: var(--primary); }

/* ---------------------------------------------------------------- Buttons */

.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .65rem 1.1rem;
  border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  cursor: pointer; text-align: center; user-select: none;
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-600); }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary-100); background: var(--surface-2); }
.btn-soft { background: var(--primary-50); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .4rem .8rem; font-size: .85rem; border-radius: 10px; }
.btn-lg { min-height: 54px; font-size: 1.02rem; border-radius: 14px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-group > form { display: contents; }

/* ---------------------------------------------------------------- Forms */

.form-group { margin-bottom: 1rem; }
.form-group label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.form-hint { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.form-control, select.form-control, textarea.form-control {
  width: 100%; min-height: 48px;
  padding: .7rem .9rem;
  font: inherit; font-size: 16px; /* evita zoom no iOS */
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-prefix .form-control { padding-left: 2.6rem; }
.input-money { font-size: 1.6rem !important; font-weight: 750; min-height: 62px; letter-spacing: -.02em; }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .form-row.cols-cep { grid-template-columns: 160px 1fr 110px; }
}
.field-validation-error, .text-validation { color: var(--danger); font-size: .82rem; display: block; margin-top: .25rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .switch-text strong { display: block; font-size: .92rem; }
.switch .switch-text small { font-size: .8rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--border); position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

/* Chips (parcelas) */
.chips { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; scroll-snap-align: start; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; height: 58px; padding: 0 .75rem;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface);
  font-weight: 750; cursor: pointer; transition: all .15s; font-size: 1.05rem;
}
.chip span small { font-size: .66rem; font-weight: 600; color: var(--muted); }
.chip input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.chip input:checked + span small { color: var(--primary); }
.chip input:disabled + span { opacity: .35; cursor: not-allowed; }

/* Resumo de valores */
.resumo-valores { display: flex; flex-direction: column; gap: .55rem; }
.resumo-valores .linha { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.resumo-valores .linha span:first-child { color: var(--muted); }
.resumo-valores .total { border-top: 1px dashed var(--border); padding-top: .65rem; font-weight: 750; font-size: 1.05rem; }
.resumo-valores .destaque { font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }

/* ---------------------------------------------------------------- Alerts / toasts */

.alert { padding: .85rem 1rem; border-radius: 12px; font-size: .9rem; display: flex; gap: .6rem; align-items: flex-start; margin-bottom: 1rem; }
.alert i { font-size: 1.1rem; line-height: 1.3; }
.alert-success { background: var(--success-50); color: var(--success); }
.alert-danger { background: var(--danger-50); color: var(--danger); }
.alert-warning { background: var(--warning-50); color: var(--warning); }
.alert-info { background: var(--info-50); color: var(--info); }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

/* SweetAlert2 no tema do site */
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.95); }
.swal2-container { font-family: inherit; }
.swal2-popup.pni-modal {
  background: var(--surface); color: var(--text);
  border-radius: 22px; padding: 1.5rem 1.25rem 1.25rem;
  width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
}
.pni-modal .swal2-title { color: var(--text); font-size: 1.25rem; font-weight: 750; padding-top: .25rem; }
.pni-modal .swal2-html-container { color: var(--muted); font-size: .95rem; margin-top: .5rem; }
.pni-modal-acoes { gap: .5rem; width: 100%; margin-top: 1.25rem !important; flex-wrap: nowrap !important; }
.pni-modal-acoes .btn { flex: 1; margin: 0; }
.pni-modal-acoes.pni-modal-acoes-col { flex-direction: column; flex-wrap: nowrap !important; }
.pni-modal-acoes-col .btn { width: 100%; flex: none; }
.swal2-icon { transform: scale(.85); margin: .5rem auto 0 !important; }
.swal2-backdrop-show { background: rgba(15, 13, 30, .55) !important; backdrop-filter: blur(2px); }

.swal2-popup.pni-toast {
  background: var(--surface) !important; color: var(--text);
  border: 1px solid var(--border); border-radius: 14px !important;
  box-shadow: var(--shadow-lg) !important; padding: .7rem .9rem !important;
  max-width: calc(100vw - 24px);
}
.pni-toast .swal2-title { color: var(--text) !important; font-size: .92rem !important; font-weight: 600 !important; margin: 0 .25rem !important; }
.pni-toast .swal2-timer-progress-bar { background: var(--primary-100); }
@media (max-width: 639px) {
  .swal2-container.swal2-top { padding-top: calc(var(--topbar-h) + 8px) !important; }
}

/* ---------------------------------------------------------------- Lists */

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: .85rem; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .list-item.clicavel:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .titulo { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { color: var(--muted); font-size: .82rem; }
.list-item .valor { font-weight: 750; text-align: right; white-space: nowrap; }
.icon-circle { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 1.15rem; flex-shrink: 0; }
.icon-circle.success { background: var(--success-50); color: var(--success); }
.icon-circle.danger { background: var(--danger-50); color: var(--danger); }
.icon-circle.warning { background: var(--warning-50); color: var(--warning); }

/* Parcelas */
.parcela-item { position: relative; cursor: pointer; }
.parcela-item.paga { cursor: default; }
.parcela-item .numero {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 750; font-size: .95rem;
}
.parcela-item.paga .numero { background: var(--success-50); color: var(--success); border-color: transparent; }
.parcela-check { position: relative; width: 26px; height: 26px; flex-shrink: 0; }
.parcela-check input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 8px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
.parcela-check input:checked { background: var(--primary); border-color: var(--primary); }
.parcela-check input:checked + i { opacity: 1; }
.parcela-check i { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; pointer-events: none; font-size: .95rem; }
.parcela-item.selecionada { background: var(--primary-50); }

/* Barra fixa de ação (acima da bottom nav) */
.action-bar {
  position: fixed; left: 0; right: 0; z-index: 35;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(28, 26, 46, .08);
  transform: translateY(120%); transition: transform .25s ease;
}
.action-bar.show { transform: translateY(0); }
.action-bar .inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.action-bar .info { flex: 1; min-width: 0; }
.action-bar .info strong { font-size: 1.15rem; display: block; }
.action-bar .info small { display: block; font-size: .78rem; }
@media (min-width: 960px) { .action-bar { bottom: 0; } }
.espaco-action-bar { height: 90px; }

/* ---------------------------------------------------------------- Gallery */

.galeria { display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.galeria::-webkit-scrollbar { display: none; }
.galeria figure { margin: 0; flex: 0 0 100%; scroll-snap-align: center; position: relative; }
.galeria img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--primary-50); }
.galeria figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.5rem .9rem .7rem; color: #fff; font-size: .85rem; background: linear-gradient(transparent, rgba(0,0,0,.6)); border-radius: 0 0 var(--radius) var(--radius); }
.galeria-dots { display: flex; justify-content: center; gap: 6px; margin-top: .6rem; }
.galeria-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: all .2s; }
.galeria-dots span.ativo { background: var(--primary); width: 20px; border-radius: 4px; }
@media (min-width: 960px) { .galeria img { aspect-ratio: 16 / 9; } }

.fotos-admin { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .fotos-admin { grid-template-columns: repeat(4, 1fr); } }
.foto-admin { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.foto-admin img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.foto-admin .acoes { display: flex; gap: .25rem; padding: .4rem; justify-content: space-between; align-items: center; }
.foto-admin .capa-badge { position: absolute; }

.upload-area { border: 2px dashed var(--border); border-radius: 14px; padding: 1.25rem; text-align: center; color: var(--muted); cursor: pointer; display: block; transition: border-color .15s, background .15s; }
.upload-area:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.upload-area i { font-size: 1.8rem; display: block; margin-bottom: .25rem; }
.upload-area input { display: none; }

/* ---------------------------------------------------------------- Bottom sheet */

.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 13, 30, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + var(--safe-bottom));
  transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--shadow-lg);
}
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 12px; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.sheet-header h2 { margin: 0; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: 460px; border-radius: 22px; transform: translate(-50%, 60%); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; padding: 20px 22px; }
  .sheet.show { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; }
  .sheet-handle { display: none; }
}

/* Pix */
.pix-box { text-align: center; }
.pix-qr { width: 220px; height: 220px; margin: 0 auto .75rem; padding: 10px; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.pix-qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.codigo-copia { display: flex; gap: .5rem; align-items: stretch; margin-top: .5rem; }
.codigo-copia code { flex: 1; min-width: 0; font-size: .75rem; padding: .7rem .75rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); text-align: left; }
.tabs { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 1rem; }
.tabs button { flex: 1; border: 0; background: transparent; padding: .6rem; border-radius: 9px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.tabs button.ativo { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.valor-grande { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }

.sucesso-pagamento { text-align: center; padding: 1.5rem 0; }
.sucesso-pagamento .icone { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; background: var(--success-50); color: var(--success); font-size: 2.6rem; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.aguardando { display: flex; align-items: center; justify-content: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin-top: 1rem; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-50); border-top-color: var(--primary); animation: girar .8s linear infinite; margin: 2rem auto; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- Tables (admin) */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
@media (max-width: 720px) {
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
  .table-responsive td { padding: .2rem 0; border: 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table-responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; }
  .table-responsive td.td-principal { font-weight: 700; font-size: 1rem; text-align: left; }
  .table-responsive td.td-principal::before { display: none; }
}

/* Filtros */
.filtros { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: 2px; }
.filtros a { flex: 0 0 auto; padding: .45rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: .85rem; }
.filtros a.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.busca { position: relative; margin-bottom: .75rem; }
.busca i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.busca .form-control { padding-left: 2.5rem; }

/* Empty state */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.6rem; color: var(--primary-100); display: block; margin-bottom: .5rem; }
.empty h3 { color: var(--text); }

/* Auth */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; background: radial-gradient(100% 60% at 50% 0%, var(--primary-50), var(--bg)); }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card .brand { justify-content: center; margin-bottom: 1.5rem; font-size: 1.2rem; }
.auth-card .brand-logo { width: 44px; height: 44px; font-size: 1.3rem; border-radius: 13px; }

.segredo { font-family: ui-monospace, Menlo, monospace; font-size: 1.15rem; font-weight: 700; letter-spacing: .05em; background: var(--surface); padding: .2rem .6rem; border-radius: 8px; border: 1px dashed currentColor; }

.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
