/**
 * Estilos personalizados — Gestão de Igreja
 */

:root {
    --sidebar-width: 260px;
    --primary: #1e3a5f;
    --primary-light: #2d5a8e;
    --sidebar-bg: #0f172a;
    --content-bg: #f1f5f9;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
}

body.app-body {
    background: var(--content-bg);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
}

.sidebar-nav__group {
    margin-bottom: 0.25rem;
}

.sidebar-nav__group:not(:first-child) .sidebar-nav__group-title {
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-nav__group-title {
    margin: 0;
    padding: 0.5rem 1.5rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.2;
}

.sidebar-nav__group .nav {
    margin-bottom: 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

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

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #60a5fa;
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Main content */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
}

/* ========== Dashboard ========== */
.page-dashboard .app-content {
    max-width: 1400px;
    margin: 0 auto;
}

.page-dashboard .navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border) !important;
}

/* Hero */
.dash-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.dash-hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(0, 0, 0, 0.12) 0%, transparent 45%);
    pointer-events: none;
}

.dash-hero__content {
    position: relative;
    padding: 1.75rem 1.5rem;
}

@media (min-width: 768px) {
    .dash-hero__content {
        padding: 2rem 2.25rem;
    }
}

.dash-hero__eyebrow {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 500;
}

.dash-hero__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dash-hero__subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    max-width: 36rem;
    line-height: 1.5;
}

.dash-hero__finance {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(8px);
}

.dash-hero__finance-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
    margin-bottom: 0.35rem;
}

.dash-hero__finance-value {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dash-hero__finance-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

.dash-hero__finance-breakdown i {
    margin-right: 0.25rem;
}

/* Quick actions */
.btn-dash-quick {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-dash-quick:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* KPI cards */
.dash-kpi-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.dash-kpi {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    height: 100%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.dash-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.dash-kpi--blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.dash-kpi--green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.dash-kpi--violet::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.dash-kpi--amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dash-kpi--slate::before { background: linear-gradient(90deg, #64748b, #94a3b8); }
.dash-kpi--rose::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.dash-kpi-link:hover .dash-kpi {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.dash-kpi__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
}

.dash-kpi--blue .dash-kpi__icon { background: #eff6ff; color: #2563eb; }
.dash-kpi--green .dash-kpi__icon { background: #ecfdf5; color: #059669; }
.dash-kpi--violet .dash-kpi__icon { background: #f5f3ff; color: #7c3aed; }
.dash-kpi--amber .dash-kpi__icon { background: #fffbeb; color: #d97706; }
.dash-kpi--slate .dash-kpi__icon { background: #f8fafc; color: #475569; }
.dash-kpi--rose .dash-kpi__icon { background: #fff1f2; color: #e11d48; }

.dash-kpi__label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.dash-kpi__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.dash-kpi__arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.dash-kpi-link:hover .dash-kpi__arrow {
    opacity: 1;
    background: #e0e7ff;
    color: #2563eb;
}

/* Panels */
.dash-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dash-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.dash-panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.dash-panel__title i {
    color: #2563eb;
}

.dash-panel__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

.dash-panel__body {
    padding: 1rem 1.5rem 1.25rem;
}

/* Dashboard insights */
.dash-year-stats__item {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.dash-year-stats__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-year-stats__item.is-current .dash-year-stats__bar span {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.dash-year-stats__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.dash-year-stats__bar {
    height: 6px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.dash-year-stats__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
    transition: width 0.35s ease;
}

.dash-finance-summary__total {
    text-align: center;
    padding: 0.75rem 0 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dash-finance-summary__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.dash-finance-summary__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.dash-finance-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
    transition: background 0.15s, transform 0.15s;
}

.dash-finance-summary__row:last-child {
    margin-bottom: 0;
}

.dash-finance-summary__row:hover {
    background: #f1f5f9;
    color: inherit;
    transform: translateX(2px);
}

.dash-finance-summary__row span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.dash-birthday-list__item {
    border-bottom: 1px solid var(--border);
}

.dash-birthday-list__item:last-child {
    border-bottom: none;
}

.dash-birthday-list__link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.dash-birthday-list__link:hover {
    background: #f8fafc;
    color: inherit;
}

.dash-birthday-list__date {
    flex-shrink: 0;
    width: 2.75rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #7c3aed;
    line-height: 1.2;
}

.dash-birthday-list__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dash-birthday-list__info strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-birthday-list__badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
}

/* Table */
.dash-table thead th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: 0.85rem 1rem;
    background: #f8fafc;
}

.dash-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.9rem;
}

.dash-table tbody tr:hover {
    background: #f8fafc;
}

.dash-date {
    font-weight: 600;
    color: var(--text);
}

.dash-badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    background: #eff6ff;
    color: #1d4ed8;
    border: none;
}

.dash-badge--muted {
    background: #f1f5f9;
    color: #475569;
}

.dash-count {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dash-count i {
    margin-right: 0.2rem;
    color: #94a3b8;
}

/* Timeline */
.dash-timeline__item {
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.dash-timeline__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-timeline__dot {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.dash-timeline__content {
    flex: 1;
    min-width: 0;
}

.dash-timeline__time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-timeline__text {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.45;
}

.dash-timeline__user {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.dash-empty--compact {
    padding: 2rem 1rem;
}

.dash-empty__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

/* ========== Página Membros ========== */
.page-membros .app-content,
.page-dashboard .app-content {
    max-width: 1400px;
    margin: 0 auto;
}

.page-membros .navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border) !important;
}

.page-header__eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2563eb;
}

.page-header__title {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.page-header__desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-page-primary {
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Mini stats membros */
.mem-stat {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    color: inherit;
    height: 100%;
}

.mem-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.mem-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.mem-stat__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

.mem-stat--green .mem-stat__value { color: #059669; }
.mem-stat--slate .mem-stat__value { color: #475569; }
.mem-stat--blue .mem-stat__value { color: #2563eb; }
.mem-stat--violet .mem-stat__value { color: #7c3aed; }

.mem-filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.mem-search .input-group-text {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text-muted);
}

.mem-search .form-control {
    border-color: var(--border);
}

.mem-search .form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dash-panel__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

.page-membros .pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border-color: var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
}

.page-membros .pagination .page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
}

/* Avatar */
.mem-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.mem-avatar--photo {
    object-fit: cover;
    border: 2px solid var(--border);
}

.mem-avatar--initials {
    color: #fff;
}

.mem-avatar--tone-0 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.mem-avatar--tone-1 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.mem-avatar--tone-2 { background: linear-gradient(135deg, #10b981, #059669); }
.mem-avatar--tone-3 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.mem-avatar--tone-4 { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* Tabela membros */
.mem-table__row {
    transition: background 0.15s;
}

.mem-table__name {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
}

.mem-table__name:hover {
    color: #2563eb;
}

.mem-table__meta {
    margin-top: 0.15rem;
}

.mem-table__code {
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    padding: 0.15em 0.45em;
    border-radius: 4px;
}

.mem-gender {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mem-gender--m i { color: #3b82f6; }
.mem-gender--f i { color: #a855f7; }

.mem-status {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.4em 0.75em;
    border-radius: 999px;
}

.mem-status--active {
    background: #ecfdf5;
    color: #047857;
}

.mem-status--inactive {
    background: #f1f5f9;
    color: #64748b;
}

.mem-local {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.4em 0.75em;
    border-radius: 999px;
}

.mem-local--sede {
    background: #eff6ff;
    color: #1d4ed8;
}

.mem-local--campo {
    background: #fff7ed;
    color: #c2410c;
}

.campo-view-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 12px;
    background: #fff7ed;
    color: #c2410c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.mem-actions {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.mem-actions .btn {
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.55rem;
    background: #fff;
}

.mem-actions .btn:last-child {
    border-right: none;
}

.mem-actions .btn:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.mem-actions__toggle:hover {
    color: #d97706 !important;
}

/* ========== Formulários — largura total da área útil ========== */
body.app-form-layout .app-content,
body[class*="-form"] .app-content,
body.page-igreja .app-content,
body.page-dizimo-add .app-content,
body.page-dizimo-form .app-content,
body.page-cota-add .app-content,
body.page-cota-form .app-content,
body.page-grupo-form .app-content,
body.page-igreja-form .app-content,
body.page-culto-form .app-content,
body.page-ebd-form .app-content,
body.page-usuario-form .app-content,
body.page-membro-view .app-content,
body.page-campo-view .app-content {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.mem-form {
    width: 100%;
    max-width: none;
}

.mem-form__grid,
.mem-form > .row.g-4,
.mem-form > .row.g-3,
.crianca-form > .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.mem-form .row > [class*="col-"],
.mem-form__grid > [class*="col-"] {
    min-width: 0;
}

/* Grelha responsiva padrão (12 colunas) */
.mem-form-fields {
    --mem-form-cols: 12;
}

.mem-form-fields > [class*="col-"] {
    min-width: 0;
}

.mem-form .form-control,
.mem-form .form-select,
.mem-form-control {
    width: 100%;
    max-width: none;
}

.mem-form-grupos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 0.5rem;
}

.mem-form-grupos > [class*="col-"] {
    width: 100%;
    max-width: none;
    padding: 0;
}

/* ========== Formulário membro ========== */
.page-membro-form .app-content {
    padding-bottom: 5rem;
}

.mem-form-breadcrumb .breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.mem-form-breadcrumb .breadcrumb-item a {
    color: #2563eb;
    text-decoration: none;
}

.mem-form-breadcrumb .breadcrumb-item a:hover {
    text-decoration: underline;
}

.mem-form-photo__body {
    padding: 1.25rem 1.5rem;
}

.mem-form-photo__preview {
    width: 160px;
    height: 160px;
    max-width: 100%;
    margin: 0 0 1.25rem;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .mem-form-photo__body {
        text-align: left;
    }

    .mem-form-photo__preview {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 767.98px) {
    .mem-form-photo__body {
        text-align: center;
    }

    .mem-form-photo__preview {
        margin-left: auto;
        margin-right: auto;
    }
}

.mem-form-photo__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mem-form-photo__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
}

.mem-form-photo__placeholder i {
    font-size: 3rem;
}

.mem-form-photo__upload {
    font-weight: 500;
    cursor: pointer;
}

.mem-form-tip {
    border-left: 3px solid #fbbf24;
}

.mem-form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.mem-form-control {
    border-color: var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
}

.mem-form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.mem-form-control[readonly] {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
}

.mem-form-control.mem-form-date,
.mem-form-control[type="date"] {
    min-width: 11rem;
    width: 100%;
}

.mem-form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mem-form-block + .mem-form-block {
    margin-top: 1.5rem;
}

/* Cards de grupos */
.mem-form-grupo-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    height: 100%;
}

.mem-form-grupo-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.mem-form-grupo-card.is-checked {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 1px #2563eb;
}

.mem-form-grupo-card input {
    margin: 0;
    flex-shrink: 0;
}

.mem-form-grupo-card__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

/* Barra de acções fixa */
.mem-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
    margin-top: 2rem;
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

/* Formulários financeiros (dízimo / cota) — duas colunas em ecrã largo */
.fin-dizimo-form > .row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.fin-dizimo-form .fin-membro-panel,
.fin-dizimo-form .membro-picker__search {
    max-width: none;
}

@media (min-width: 992px) {
    .fin-dizimo-form > .row > .col-lg-6 {
        flex: 0 0 auto;
        width: 50%;
    }
}

/* Formulários simples (grupo, campo) — painel a 100% */
.mem-form--panel .dash-panel {
    width: 100%;
}

body.app-form-layout .page-header,
body[class*="-form"] .page-header {
    max-width: none;
}

@media (max-width: 991.98px) {
    .mem-form-photo__preview {
        width: 120px;
        height: 120px;
    }

    .mem-form-actions {
        justify-content: stretch;
    }

    .mem-form-actions .btn {
        flex: 1;
    }
}

/* Legacy stat cards (outras páginas) */
.stat-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 100%;
}

/* Tabelas */
.table-actions .btn {
    padding: 0.25rem 0.5rem;
}

.membro-foto {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid #dee2e6;
}

.membro-foto-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

/* Form sections */
.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Sidebar overlay — comportamento mobile em responsive.css */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

/* Financeiro / dízimos — formulário e pesquisa de membro */
.fin-add-period-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.fin-add-period-badge--cota {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
}

.fin-tipos-grid {
    margin-top: 0;
}

.fin-tipo-card {
    display: block;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fin-tipo-card:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow-sm);
}

.fin-tipo-card--active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.fin-tipo-card__name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.fin-tipo-card__grupo {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.fin-tipo-card__meta {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.fin-cota-tipo {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Crianças */
.mem-avatar--child {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}

.mem-avatar--child-f {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #be185d;
}

.mem-avatar--child-m {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.crianca-classe-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 600;
}

.crianca-form-aside {
    position: sticky;
    top: 1rem;
}

.page-criancas .dash-empty__icon i {
    color: #f59e0b;
}

/* Cultos */
.culto-total-badge {
    padding: 0.5rem 1rem;
    background: #eff6ff;
    border-radius: 999px;
    font-size: 0.9rem;
    color: #1e40af;
}

.culto-tipo {
    font-size: 0.72rem;
    font-weight: 600;
}

.culto-tipo--Dominical { background: #dbeafe; color: #1d4ed8; }
.culto-tipo--SantaCeia { background: #ede9fe; color: #6d28d9; }
.culto-tipo--CultodeOrao { background: #fef3c7; color: #b45309; }
.culto-tipo--CultoEspecial { background: #fce7f3; color: #be185d; }
.culto-tipo--Outro { background: #f1f5f9; color: #475569; }

.culto-presenca-mini {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.culto-view-hero {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.culto-stat-pill {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.culto-stat-pill__n {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.culto-stat-pill span:last-child {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.culto-stat-pill--f { background: #fdf2f8; border-color: #fbcfe8; }
.culto-stat-pill--j { background: #fffbeb; border-color: #fde68a; }
.culto-stat-pill--c { background: #ecfdf5; border-color: #a7f3d0; }
.culto-stat-pill--v { background: #f5f3ff; border-color: #ddd6fe; }
.culto-stat-pill--total { background: #eff6ff; border-color: #93c5fd; }
.culto-stat-pill--total .culto-stat-pill__n { color: #1d4ed8; }

.culto-inline-form {
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.page-cultos .dash-empty__icon i {
    color: #6366f1;
}

.fin-period-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.fin-period-chip strong {
    color: var(--text);
}

.fin-membro-panel .dash-panel__body {
    min-height: 220px;
}

/* EBD — selector de professor (membro) */
.page-ebd-form .ebd-professor-panel {
    border: 1px solid #c7d2fe;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
    overflow: visible;
}

.page-ebd-form .ebd-professor-panel .dash-panel__header {
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
}

.page-ebd-form .ebd-professor-panel .dash-panel__body {
    min-height: 12rem;
    overflow: visible;
}

.page-ebd-form .membro-picker--ebd {
    max-width: 100%;
}

.page-ebd-form .membro-picker--ebd .membro-picker__search-zone {
    position: relative;
    padding: 1.1rem 1.15rem;
    background: #fff;
    border: 2px solid #c7d2fe;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.06);
}

.page-ebd-form .membro-picker--ebd .membro-picker__search-zone--error {
    border-color: #dc3545;
}

.page-ebd-form .membro-picker--ebd .membro-picker__search {
    min-height: 3.25rem;
    font-size: 1.0625rem;
    background: #f8fafc;
    border-width: 2px;
}

.page-ebd-form .membro-picker--ebd .membro-picker__search:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.page-ebd-form .membro-picker--ebd .membro-picker__search-icon {
    font-size: 1.15rem;
    color: #4f46e5;
}

.page-ebd-form .membro-picker--ebd .membro-picker__hint {
    font-size: 0.8125rem;
    margin-top: 0.65rem;
}

.page-ebd-form .membro-picker--ebd .membro-picker__hint kbd {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
}

.page-ebd-form .membro-picker--ebd .membro-picker__search-zone {
    overflow: visible;
}

.page-ebd-form .membro-picker--ebd .membro-picker__results {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    z-index: 30;
    max-height: 320px;
    min-height: 3rem;
    margin-top: 0.75rem;
    border: 2px solid #c7d2fe;
    background: #fff;
}

.page-ebd-form .membro-picker--ebd .membro-picker__results.membro-picker__results--open {
    display: block !important;
}

.page-ebd-form .membro-picker--ebd .membro-picker__empty:not(.d-none) {
    display: block !important;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.page-ebd-form .membro-picker--ebd.membro-picker--inline .membro-picker__results--open {
    display: block !important;
}

.page-ebd-form .membro-picker--ebd .membro-picker__selected {
    margin-top: 1rem;
    max-width: 100%;
}

.page-ebd-form .mem-form--panel .dash-panel__body {
    overflow: visible;
}

/* EBD — acordeão por classe */
.ebd-classes-panel {
    overflow: visible;
}

.ebd-classes-accordion .accordion-item {
    border-left: none;
    border-right: none;
}

.ebd-class-accordion-btn {
    font-weight: 600;
    gap: 0.35rem;
}

.ebd-class-accordion-btn:not(.collapsed) {
    background: #eef2ff;
    color: #312e81;
}

.ebd-class-accordion-preview {
    max-width: 40%;
}

.ebd-class-ofertas {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
}

@media (max-width: 575.98px) {
    .ebd-class-accordion-preview {
        display: none;
    }
}

.fin-valor-input .form-control-lg {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fin-form-tips {
    border-left: 3px solid #f59e0b;
}

.fin-form-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Member picker */
.membro-picker {
    position: relative;
}

.membro-picker__search-wrap {
    position: relative;
}

.membro-picker__search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.membro-picker__search {
    padding-left: 2.75rem !important;
    padding-right: 2.5rem !important;
    min-height: 48px;
    border-radius: 12px !important;
    font-size: 1rem;
    border: 2px solid var(--border);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.membro-picker__search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.membro-picker__search-zone--error .membro-picker__search {
    border-color: #dc3545;
}

.membro-picker__clear-search {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.membro-picker__clear-search:hover {
    background: #f1f5f9;
    color: var(--text);
}

.membro-picker__hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0;
}

.membro-picker__results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
}

.membro-picker__results--open {
    display: block;
}

.membro-picker__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

.membro-picker__item:last-child {
    border-bottom: none;
}

.membro-picker__item:hover,
.membro-picker__item--active {
    background: #eff6ff;
}

.membro-picker__item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.membro-picker__item-text strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.membro-picker__item-text small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.membro-picker__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4338ca;
}

.membro-picker__avatar--lg {
    width: 56px;
    height: 56px;
    font-size: 1rem;
}

.membro-picker__avatar--photo {
    object-fit: cover;
}

.membro-picker__selected {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #a7f3d0;
    border-radius: 14px;
}

.membro-picker__selected--static {
    background: #f8fafc;
    border-color: var(--border);
}

.membro-picker__selected-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.membro-picker__selected-info strong {
    font-size: 1rem;
}

.membro-picker__selected-info code {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: transparent;
}

.membro-picker__change {
    margin-top: 0.75rem;
}

.membro-picker--has-value .membro-picker__change {
    display: inline-block !important;
}

@media (max-width: 991.98px) {
    .membro-picker__results {
        position: relative;
        box-shadow: var(--shadow);
    }
}

.fin-stat__value--sm {
    font-size: 1.1rem;
    line-height: 1.3;
}

.fin-valor {
    color: #047857;
    font-variant-numeric: tabular-nums;
}

.fin-period {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.fin-pay {
    font-size: 0.72rem;
    font-weight: 600;
}

.fin-pay--cash { background: #ecfdf5; color: #047857; }
.fin-pay--transfer { background: #eff6ff; color: #1d4ed8; }
.fin-pay--tpa { background: #f5f3ff; color: #6d28d9; }
.fin-pay--other { background: #f1f5f9; color: #475569; }

/* Grupos */
.grp-view-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #4338ca;
}

.grp-tipo {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.grp-tipo--Homens { background: #dbeafe; color: #1d4ed8; }
.grp-tipo--Mulheres { background: #fce7f3; color: #be185d; }
.grp-tipo--Jovens { background: #fef3c7; color: #b45309; }
.grp-tipo--Coral { background: #ede9fe; color: #6d28d9; }
.grp-tipo--Crianas { background: #d1fae5; color: #047857; }
.grp-tipo--Outro { background: #f1f5f9; color: #475569; }

/* Utilizadores */
.usr-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.usr-perfil {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 999px;
}

.usr-perfil--admin { background: #fef3c7; color: #b45309; }
.usr-perfil--pastor { background: #ede9fe; color: #6d28d9; }
.usr-perfil--tesoureiro { background: #d1fae5; color: #047857; }
.usr-perfil--secretaria { background: #dbeafe; color: #1d4ed8; }
.usr-perfil--ebd { background: #ccfbf1; color: #0f766e; }
.usr-perfil--default { background: #f1f5f9; color: #475569; }

.usr-modulos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.usr-perfil-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    height: 100%;
}

/* EBD */
.ebd-badge {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
}

.ebd-view-hero {
    padding: 0.25rem 0 0;
}

.page-ebd .fin-valor {
    font-weight: 700;
    color: #047857;
}

.ebd-classes-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.65rem;
}

.ebd-classes-legend__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    text-align: center;
    min-height: 88px;
    justify-content: center;
}

.ebd-classes-legend__item--filled {
    background: #f0fdf4;
    border-color: #86efac;
}

.ebd-classes-legend__total {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.ebd-presencas-table .ebd-classe {
    font-size: 0.8rem;
    white-space: normal;
}

.ebd-classe {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.45em 0.85em;
    border-radius: 999px;
    line-height: 1.35;
    white-space: nowrap;
}

.ebd-classe--primarios { background: #fef3c7; color: #b45309; }
.ebd-classe--adolescentes { background: #fce7f3; color: #be185d; }
.ebd-classe--doutrinaria { background: #e0e7ff; color: #4338ca; }
.ebd-classe--jovens { background: #dbeafe; color: #1d4ed8; }
.ebd-classe--adultos { background: #d1fae5; color: #047857; }
.ebd-classe--default { background: #f1f5f9; color: #475569; }

/* Matrículas EBD — selector de aluno */
.ebd-aluno-picker { position: relative; }
.ebd-aluno-picker__results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    display: none;
    margin-top: 0.25rem;
}
.ebd-aluno-picker__results--open { display: block; }
.ebd-aluno-picker__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.ebd-aluno-picker__item:hover,
.ebd-aluno-picker__item--active { background: #f0fdfa; }
.ebd-aluno-picker__badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}
.ebd-aluno-picker__badge--membro { background: #dbeafe; color: #1d4ed8; }
.ebd-aluno-picker__badge--crianca { background: #fce7f3; color: #be185d; }
.ebd-aluno-picker__badge--assistente { background: #fef3c7; color: #b45309; }
.ebd-aluno-picker__selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}
.ebd-aluno-picker__search-zone--error .ebd-aluno-picker__search,
.ebd-aluno-picker__search-zone--error .membro-picker__search {
    border-color: #dc3545;
}
.page-matriculas-ebd .ebd-classes-legend__item { cursor: pointer; transition: transform 0.15s ease; }
.page-matriculas-ebd .ebd-classes-legend__item:hover { transform: translateY(-2px); }

/* Dados da igreja */
.sidebar-brand__logo {
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.igreja-logo-preview img,
.igreja-logo-preview .mem-form-photo__placeholder {
    max-height: 140px;
    object-fit: contain;
}
.relatorio-print-header__logo {
    object-fit: contain;
    border-radius: 8px;
}
@media print {
    .relatorio-print-header__logo { max-height: 64px; }
}

/* Logs de acções */
.log-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.75em;
    border-radius: 999px;
    white-space: nowrap;
}

.log-badge--login { background: #dbeafe; color: #1d4ed8; }
.log-badge--success { background: #d1fae5; color: #047857; }
.log-badge--info { background: #e0e7ff; color: #4338ca; }
.log-badge--warning { background: #fef3c7; color: #b45309; }
.log-badge--danger { background: #fee2e2; color: #b91c1c; }
.log-badge--muted { background: #f1f5f9; color: #64748b; }
.log-badge--default { background: #f8fafc; color: #475569; border: 1px solid var(--border); }

.log-modulo {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.log-desc {
    max-width: 420px;
    line-height: 1.4;
}

.log-row__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}

.log-stat-link {
    text-decoration: none;
    color: inherit;
}

.log-stat-link:hover .mem-stat {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Relatórios — hub e impressão */
.page-relatorios .relatorio-grid {
    margin-bottom: 1rem;
}

.relatorio-grid .rel-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.relatorio-grid .rel-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: inherit;
}

.rel-card__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.rel-card--blue .rel-card__icon { background: #dbeafe; color: #1d4ed8; }
.rel-card--green .rel-card__icon { background: #d1fae5; color: #047857; }
.rel-card--violet .rel-card__icon { background: #ede9fe; color: #6d28d9; }
.rel-card--amber .rel-card__icon { background: #fef3c7; color: #b45309; }
.rel-card--indigo .rel-card__icon { background: #e0e7ff; color: #4338ca; }
.rel-card--slate .rel-card__icon { background: #f1f5f9; color: #475569; }
.rel-card--teal .rel-card__icon { background: #ccfbf1; color: #0f766e; }
.rel-card--emerald .rel-card__icon { background: #d1fae5; color: #059669; }
.rel-card--orange .rel-card__icon { background: #ffedd5; color: #c2410c; }

.rel-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.rel-card__desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 0.75rem;
}

.rel-card__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-light);
}

.relatorio-print-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.relatorio-print-header__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.relatorio-print-header__logo-slot {
    flex: 0 0 72px;
    width: 72px;
    min-height: 64px;
    display: flex;
    align-items: center;
}

.relatorio-print-header__logo-slot--left {
    justify-content: flex-start;
}

.relatorio-print-header__logo-slot--right {
    justify-content: flex-end;
}

.relatorio-print-header__text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.relatorio-print-header__denominacao {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.3;
}

.relatorio-print-header__igreja {
    line-height: 1.25;
}

.relatorio-print-header__logo {
    object-fit: contain;
    border-radius: 8px;
    max-width: 72px;
    max-height: 72px;
    width: auto;
    height: auto;
}

.relatorio-tabela {
    font-size: 0.875rem;
}

.relatorio-tabela th,
.relatorio-tabela td {
    vertical-align: middle;
}

/* Pesquisa global na navbar */
.app-navbar--with-search .container-fluid {
    gap: 0.25rem;
}

.navbar-global-search {
    max-width: 420px;
}

.navbar-global-search__input-group .form-control:focus {
    box-shadow: none;
}

.navbar-global-search__dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: min(70vh, 420px);
    overflow-y: auto;
}

.navbar-global-search__item:hover,
.navbar-global-search__item.is-active {
    background: var(--bs-primary-bg-subtle, #e8f0fe);
}

.navbar-global-search__group-title {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.navbar-global-search__empty {
    text-align: center;
}

.log-filtros-chips__badge:hover {
    background: var(--bs-primary) !important;
    color: #fff !important;
}

.listagem-filtros-url__code {
    font-size: 0.75rem;
    background: #f1f5f9;
    padding: 0.35rem 0.5rem;
    border-radius: 0.35rem;
}

/* Notificações (navbar) */
.app-notificacoes__menu {
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 32rem);
    overflow: hidden;
}

.app-notificacoes__body {
    max-height: min(60vh, 28rem);
    overflow-y: auto;
}

.app-notificacoes__badge {
    font-size: 0.65rem;
    min-width: 1.1rem;
}

.app-notificacoes__group-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 1rem 0.5rem;
    background: #f8fafc;
}

.app-notificacoes__group-head .bi {
    font-size: 1.25rem;
    color: var(--bs-warning);
}

.app-notificacoes__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
}

.app-notificacoes__item:hover {
    background: #f8fafc;
}

.app-notificacoes__item--hoje {
    background: #fffbeb;
}

.app-notificacoes__item--hoje:hover {
    background: #fef3c7;
}

.app-notificacoes__item-date {
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--bs-primary);
}

.app-notificacoes__item-body {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-notificacoes__item-body strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-notificacoes__item-body small {
    color: #64748b;
}

.app-notificacoes__group-foot {
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.app-notificacoes-banner {
    border-bottom: 1px solid #fde68a !important;
}

@media (max-width: 991.98px) {
    .navbar-global-search {
        display: none;
        max-width: none;
        order: 5 !important;
    }

    .navbar-global-search.is-open {
        display: block;
    }

    .app-navbar--with-search .navbar-brand {
        max-width: 42%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Comparativo financeiro (dashboard) */
.fin-comp-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    height: 100%;
}

.fin-comp-card--actual {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-color: #bfdbfe;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.fin-comp-card__eyebrow {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.fin-comp-card__period {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.fin-comp-card__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #059669;
    letter-spacing: -0.02em;
}

.fin-comp-card__hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.fin-comp-card__saldo {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.fin-comp-variacoes__item {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    height: 100%;
}

.fin-comp-variacoes__item strong {
    font-size: 1.1rem;
}

.fin-comp-chart-wrap {
    position: relative;
    height: 320px;
    width: 100%;
}

@media (min-width: 768px) {
    .fin-comp-chart-wrap {
        height: 360px;
    }
}

.fin-comp-chart-wrap--sm {
    height: 240px;
}

@media (min-width: 768px) {
    .fin-comp-chart-wrap--sm {
        height: 260px;
    }
}

/* Histórico gráfico de cultos */
.cultos-grafico__canvas-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.cultos-grafico__canvas-wrap--combo {
    height: 320px;
}

.cultos-grafico--compact .cultos-grafico__canvas-wrap--combo {
    height: 260px;
}

.page-cultos-grafico .cultos-grafico__canvas-wrap {
    height: 300px;
}

@media print {
    .cultos-grafico {
        display: none;
    }
}
