/*
 * Portal do Templo — Emerald Experience 5.0
 * Camada visual responsiva. Mantém a estrutura e as integrações do plugin.
 */

:root {
    --emerald-950: #042f2e;
    --emerald-900: #064e3b;
    --emerald-800: #065f46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-300: #6ee7b7;
    --emerald-200: #a7f3d0;
    --emerald-100: #d1fae5;
    --emerald-50: #ecfdf5;
    --jade-bg: #f4fbf7;
    --jade-surface: #ffffff;
    --jade-surface-soft: #eaf8f0;
    --jade-ink: #102a24;
    --jade-ink-soft: #29483f;
    --jade-muted: #5b746d;
    --jade-line: #cfe9dc;
    --jade-shadow: 0 16px 45px rgba(6, 78, 59, .09);
    --jade-shadow-soft: 0 6px 20px rgba(6, 78, 59, .07);
    --jade-radius: 20px;
    --jade-radius-sm: 13px;

    /* Compatibilidade com os componentes existentes */
    --obsidian: var(--jade-bg);
    --obsidian-light: #edf8f2;
    --graphite: var(--jade-surface);
    --graphite-light: var(--jade-surface-soft);
    --champagne: var(--emerald-700);
    --champagne-light: var(--emerald-600);
    --champagne-dark: var(--emerald-900);
    --gold: var(--emerald-700);
    --gold-light: var(--emerald-500);
    --gold-dark: var(--emerald-900);
    --gold-glow: rgba(16, 185, 129, .22);
    --primary: var(--emerald-950);
    --primary-light: var(--emerald-900);
    --accent: var(--emerald-700);
    --accent-light: var(--emerald-500);
    --accent-subtle: rgba(16, 185, 129, .10);
    --accent-glow: rgba(16, 185, 129, .18);
    --bg-base: var(--jade-bg);
    --bg-card: var(--jade-surface);
    --bg-elevated: var(--jade-surface-soft);
    --bg-input: #f8fcfa;
    --border-light: var(--jade-line);
    --border-medium: #b5deca;
    --border-accent: var(--emerald-500);
    --text-primary: var(--jade-ink);
    --text-secondary: var(--jade-ink-soft);
    --text-muted: var(--jade-muted);
    --text-tertiary: #46655d;
    --shadow-sm: var(--jade-shadow-soft);
    --shadow-md: var(--jade-shadow);
    --shadow-lg: 0 22px 65px rgba(6, 78, 59, .14);
    --shadow-gold: 0 10px 35px rgba(16, 185, 129, .18);
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body.templo-emerald,
.templo-app,
.templo-light {
    color: var(--jade-ink) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(110, 231, 183, .22), transparent 28rem),
        radial-gradient(circle at 0% 100%, rgba(167, 243, 208, .18), transparent 30rem),
        var(--jade-bg) !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body.templo-emerald::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: .34;
    background-image: radial-gradient(rgba(6, 95, 70, .16) .65px, transparent .65px);
    background-size: 20px 20px;
    mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

body.templo-emerald *,
.templo-app *,
.templo-light * {
    box-sizing: border-box;
}

body.templo-emerald :focus-visible,
.templo-app :focus-visible,
.templo-light :focus-visible {
    outline: 3px solid rgba(16, 185, 129, .35) !important;
    outline-offset: 2px;
}

/* Painéis administrativos e de membro */
.templo-app {
    min-height: 100vh;
    background: transparent !important;
}

.templo-sidebar {
    width: 276px !important;
    background: linear-gradient(180deg, var(--emerald-950), var(--emerald-900)) !important;
    border-right: 0 !important;
    box-shadow: 18px 0 60px rgba(4, 47, 46, .12) !important;
}

.templo-sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(110, 231, 183, .16), transparent 34%);
}

.templo-sidebar-header,
.templo-sidebar-nav,
.templo-sidebar-footer {
    position: relative;
    z-index: 1;
}

.templo-sidebar-header {
    padding: 24px 22px 18px !important;
    border-bottom-color: rgba(209, 250, 229, .12) !important;
}

.templo-sidebar-logo {
    width: 76px !important;
    height: 76px !important;
    border: 3px solid var(--emerald-300) !important;
    box-shadow: 0 0 0 7px rgba(110, 231, 183, .09), 0 12px 26px rgba(0, 0, 0, .18) !important;
}

.templo-sidebar-header h2,
.templo-sidebar-header p,
.templo-user-name {
    color: #f0fdf7 !important;
}

.templo-user-role {
    color: var(--emerald-300) !important;
}

.templo-nav-item {
    min-height: 47px;
    margin: 3px 12px;
    padding: 12px 14px !important;
    border: 0 !important;
    border-radius: 12px;
    color: #cce9dc !important;
    font-size: 13px !important;
    transition: background .22s ease, color .22s ease, transform .22s ease !important;
}

.templo-nav-item:hover,
.templo-nav-item.active {
    color: #fff !important;
    background: rgba(110, 231, 183, .14) !important;
    transform: translateX(4px);
    box-shadow: inset 3px 0 0 var(--emerald-300);
}

.templo-sidebar-footer {
    border-top-color: rgba(209, 250, 229, .12) !important;
    padding: 16px 20px 20px !important;
}

.templo-btn-portal,
.templo-btn-logout {
    color: #e8fff4 !important;
    border-color: rgba(167, 243, 208, .28) !important;
    background: rgba(255, 255, 255, .06) !important;
}

.templo-main {
    margin-left: 276px !important;
    padding: 38px clamp(24px, 4vw, 58px) 58px !important;
    background: transparent !important;
    min-width: 0;
}

.templo-page.active {
    animation: jade-page-in .42s cubic-bezier(.16, 1, .3, 1);
}

@keyframes jade-page-in {
    from { opacity: 0; transform: translateY(12px) scale(.995); }
    to { opacity: 1; transform: none; }
}

.templo-welcome {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px !important;
    padding: 28px 30px;
    border: 1px solid var(--jade-line);
    border-radius: 24px;
    background: linear-gradient(135deg, #fff 0%, var(--emerald-50) 100%);
    box-shadow: var(--jade-shadow-soft);
}

.templo-welcome::after {
    content: "";
    position: absolute;
    right: -55px;
    top: -75px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 28px solid rgba(16, 185, 129, .08);
    animation: jade-float 6s ease-in-out infinite;
}

@keyframes jade-float {
    50% { transform: translateY(10px) rotate(8deg); }
}

.templo-welcome h1,
.templo-page-header h1,
.templo-page > h1 {
    color: var(--jade-ink) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    font-family: Marcellus, Georgia, serif !important;
    letter-spacing: -.02em !important;
}

.templo-welcome h1 { font-size: clamp(28px, 4vw, 40px) !important; }
.templo-welcome p,
.templo-page-desc { color: var(--jade-muted) !important; }

.templo-stats-grid {
    gap: 16px !important;
    margin-bottom: 24px !important;
}

.templo-stat-card,
.templo-card,
.templo-card-action,
.templo-lista-card,
.templo-grupo-card,
.templo-stat-box,
.templo-app-card,
.templo-gira-chamada,
.templo-assiduidade-item,
.templo-pendente-card,
.templo-ficha-card,
.templo-membro-card {
    color: var(--jade-ink) !important;
    background: var(--jade-surface) !important;
    border: 1px solid var(--jade-line) !important;
    border-radius: var(--jade-radius) !important;
    box-shadow: var(--jade-shadow-soft) !important;
}

.templo-stat-card {
    min-height: 116px;
    padding: 20px !important;
}

.templo-stat-card::before {
    width: 5px !important;
    height: 100% !important;
    background: linear-gradient(var(--emerald-300), var(--emerald-700)) !important;
}

.templo-stat-card:hover,
.templo-card-action:hover,
.templo-lista-card:hover,
.templo-grupo-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--emerald-300) !important;
    box-shadow: var(--jade-shadow) !important;
}

.templo-stat-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    font-size: 27px !important;
    border-radius: 16px;
    background: var(--emerald-50);
}

.templo-stat-value,
.templo-stat-numero,
.templo-stat-num,
.templo-card-action h3,
.templo-lista-header h3,
.templo-gira-chamada h3,
.templo-app-download h2,
.templo-card h3 {
    color: var(--emerald-900) !important;
}

.templo-stat-label,
.templo-card p,
.templo-card-action p,
.templo-lista-data,
.templo-lista-stats,
.templo-grupo-desc,
.templo-grupo-stats-mini,
.templo-app-download > p {
    color: var(--jade-muted) !important;
}

.templo-card {
    padding: clamp(18px, 2.5vw, 28px) !important;
}

.templo-card h3 {
    border-bottom-color: var(--jade-line) !important;
    font-size: 16px !important;
}

.templo-grid-2 { gap: 18px !important; }

/* Centro de atenção: aniversário, próxima gira e pendências */
.templo-attention-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.templo-alerta-aniversario,
.templo-alerta-pendentes,
.templo-alerta-proxima-gira {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 92px;
    margin-bottom: 14px !important;
    padding: 17px 48px 17px 18px !important;
    border: 1px solid #bde7d2 !important;
    border-radius: 18px !important;
    color: var(--jade-ink) !important;
    background: linear-gradient(135deg, #ffffff 0%, #e9fbf2 100%) !important;
    box-shadow: var(--jade-shadow-soft) !important;
    animation: jade-alert-in .45s cubic-bezier(.16, 1, .3, 1) both !important;
}

.templo-alerta-proxima-gira {
    cursor: pointer;
    border-color: #9dddc0 !important;
    background: linear-gradient(135deg, #e8fff4, #d7f8e7) !important;
}

@keyframes jade-alert-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

.templo-alerta-icon {
    display: grid;
    place-items: center;
    width: 51px;
    height: 51px;
    flex: 0 0 51px;
    border-radius: 15px;
    font-size: 25px !important;
    background: rgba(16, 185, 129, .12);
    animation: none !important;
}

.templo-alerta-content strong,
.templo-alerta-content div,
.templo-alerta-btn {
    color: var(--jade-ink) !important;
}

.templo-alerta-content strong {
    font-size: 13px !important;
    letter-spacing: .06em !important;
}

.templo-alerta-content div { font-size: 14px !important; }
.templo-alerta-btn { font-weight: 700; font-size: 12px; }
.templo-alerta-close { color: var(--emerald-900) !important; }

.templo-aniv-list,
.templo-giras-list { margin: 0; padding: 0; }

.templo-aniv-list li,
.templo-giras-list li {
    margin-bottom: 8px;
    padding: 12px 14px !important;
    border: 1px solid var(--jade-line) !important;
    border-radius: 12px;
    background: #f9fdfb;
    color: var(--jade-ink-soft) !important;
}

.templo-giras-list li strong { color: var(--emerald-800) !important; }

.templo-notification-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--emerald-900);
    background: var(--emerald-100);
    font-size: 11px;
    font-weight: 700;
}

/* Formulários */
.templo-section,
.templo-fieldset {
    padding: 22px !important;
    border: 1px solid var(--jade-line) !important;
    border-radius: 17px !important;
    background: #fbfefc !important;
}

.templo-section h3 { color: var(--emerald-900) !important; }

.templo-field { position: relative; }

.templo-field label,
.templo-input-label {
    color: var(--jade-ink-soft) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: .01em !important;
    text-transform: none !important;
}

.templo-field input,
.templo-field select,
.templo-field textarea,
.templo-input,
.templo-select,
.templo-search-input {
    width: 100%;
    min-height: 51px;
    padding: 13px 15px !important;
    border: 1.5px solid #bedfce !important;
    border-radius: var(--jade-radius-sm) !important;
    color: var(--jade-ink) !important;
    background: #fff !important;
    caret-color: var(--emerald-700);
    box-shadow: 0 1px 0 rgba(6, 78, 59, .03) !important;
    transition: border .2s ease, box-shadow .2s ease, transform .2s ease !important;
}

.templo-field textarea { min-height: 125px; line-height: 1.55; }

.templo-field input::placeholder,
.templo-field textarea::placeholder,
.templo-input::placeholder { color: #789087 !important; opacity: 1; }

.templo-field input:focus,
.templo-field select:focus,
.templo-field textarea:focus,
.templo-input:focus,
.templo-select:focus,
.templo-search-input:focus {
    border-color: var(--emerald-600) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .13) !important;
    outline: none !important;
}

.templo-field.is-complete::after {
    content: "✓";
    position: absolute;
    top: 35px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    color: #fff;
    background: var(--emerald-600);
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.templo-field.is-complete:has(textarea)::after,
.templo-field.is-complete:has(select)::after,
.templo-field.is-complete:has(input[type="file"])::after { display: none; }

.templo-form-progress {
    position: sticky;
    top: 70px;
    z-index: 20;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--jade-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--jade-shadow-soft);
    backdrop-filter: blur(12px);
}

.templo-form-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--jade-ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.templo-form-progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--emerald-100);
}

.templo-form-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--emerald-600), var(--emerald-300));
    transition: width .28s ease;
}

.templo-field-counter {
    display: block;
    margin-top: 5px;
    text-align: right;
    color: var(--jade-muted);
    font-size: 11px;
}

.templo-password-toggle {
    position: absolute;
    right: 9px;
    bottom: 9px;
    min-width: 62px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    color: var(--emerald-900);
    background: var(--emerald-100);
    font-weight: 700;
    cursor: pointer;
}

.templo-field:has(.templo-password-toggle) input { padding-right: 82px !important; }

.templo-upload-box,
.templo-upload-label {
    color: var(--jade-ink-soft) !important;
    border-color: var(--emerald-300) !important;
    background: var(--emerald-50) !important;
}

.templo-upload-box:hover,
.templo-upload-box.is-dragging {
    border-color: var(--emerald-600) !important;
    background: #fff !important;
}

.templo-btn-primary,
.templo-btn-submit,
.templo-btn-sm,
.templo-btn-ver,
.templo-btn-yes,
button.templo-btn-primary {
    min-height: 46px;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--emerald-800), var(--emerald-600)) !important;
    box-shadow: 0 9px 22px rgba(5, 150, 105, .18) !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
}

.templo-btn-primary:hover,
.templo-btn-submit:hover,
.templo-btn-sm:hover,
.templo-btn-ver:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 13px 28px rgba(5, 150, 105, .25) !important;
}

.templo-btn-secondary,
.templo-btn-sm-secondary {
    color: var(--emerald-900) !important;
    border-color: var(--jade-line) !important;
    background: #fff !important;
}

.templo-tabs,
.templo-ficha-tabs,
.templo-chamada-tabs {
    gap: 8px !important;
    padding: 5px;
    border: 1px solid var(--jade-line);
    border-radius: 14px;
    background: var(--emerald-50);
}

.templo-tab {
    min-height: 41px;
    border: 0 !important;
    border-radius: 10px !important;
    color: var(--jade-muted) !important;
}

.templo-tab.active {
    color: #fff !important;
    background: var(--emerald-700) !important;
    box-shadow: 0 5px 14px rgba(6, 120, 87, .18);
}

/* Tabelas e listas: rolagem clara e confortável */
.templo-table-container {
    border: 1px solid var(--jade-line) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: var(--jade-shadow-soft);
}

.templo-table { color: var(--jade-ink) !important; background: #fff !important; }
.templo-table th {
    color: var(--emerald-950) !important;
    background: var(--emerald-50) !important;
    border-color: var(--jade-line) !important;
}
.templo-table td { color: var(--jade-ink-soft) !important; border-color: var(--jade-line) !important; }
.templo-table tbody tr:hover { background: #f2fbf6 !important; }

.templo-item-lista,
.templo-usuario-item,
.templo-presente-item,
.templo-membro-grupo-item,
.templo-membro-add-item {
    color: var(--jade-ink) !important;
    background: #f7fcf9 !important;
    border: 1px solid var(--jade-line) !important;
    border-radius: 12px !important;
}

.templo-item-info strong,
.templo-usuario-info strong,
.templo-presente-info strong,
.templo-membro-mini-info strong,
.templo-membro-add-item span { color: var(--jade-ink) !important; }

/* Calendário */
.templo-calendario {
    border-color: var(--jade-line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--jade-shadow-soft);
}
.templo-cal-header { background: var(--emerald-50) !important; border-color: var(--jade-line) !important; }
.templo-cal-header span { color: var(--emerald-900) !important; }
.templo-cal-day { border-color: var(--jade-line) !important; background: #fff !important; }
.templo-cal-day.empty { background: #f7fbf9 !important; }
.templo-cal-day.hoje { background: var(--emerald-50) !important; }
.templo-cal-day.hoje .templo-cal-num { color: #fff !important; background: var(--emerald-700) !important; }
.templo-cal-num { color: var(--jade-ink) !important; }
.templo-cal-event { color: #fff !important; background: var(--emerald-700) !important; }

/* Modais */
.templo-modal {
    background: rgba(4, 47, 46, .48) !important;
    backdrop-filter: blur(7px);
}
.templo-modal-content {
    color: var(--jade-ink) !important;
    background: var(--jade-bg) !important;
    border: 1px solid var(--jade-line) !important;
    border-radius: 22px !important;
    box-shadow: 0 28px 80px rgba(4, 47, 46, .25) !important;
}
.templo-modal-header,
.templo-modal-actions {
    color: var(--jade-ink) !important;
    background: rgba(255, 255, 255, .96) !important;
    border-color: var(--jade-line) !important;
}
.templo-modal-header h2 { color: var(--emerald-950) !important; }
.templo-modal-close { color: var(--emerald-900) !important; background: var(--emerald-100) !important; }

/* Blocos antigos com cores inline escuras */
.templo-app [style*="background:#1a1a1a"],
.templo-app [style*="background: #1a1a1a"],
.templo-app [style*="background:#141414"],
.templo-app [style*="background: #141414"] {
    background: #fff !important;
    border-color: var(--jade-line) !important;
}
.templo-app [style*="color:#fff"],
.templo-app [style*="color: #fff"] { color: var(--jade-ink) !important; }
.templo-app [style*="color:#888"],
.templo-app [style*="color: #888"],
.templo-app [style*="color:#666"],
.templo-app [style*="color: #666"] { color: var(--jade-muted) !important; }
.templo-app [style*="color:#d4c4a8"],
.templo-app [style*="color: #d4c4a8"] { color: var(--emerald-800) !important; }

/* Banner de push */
.templo-push-banner {
    color: var(--jade-ink) !important;
    background: #fff !important;
    border: 1px solid var(--emerald-300) !important;
    box-shadow: 0 24px 70px rgba(4, 47, 46, .22) !important;
}
.templo-push-banner h3 { color: var(--emerald-900) !important; }
.templo-push-banner p { color: var(--jade-muted) !important; }
.templo-push-btn-yes { color: #fff !important; background: var(--emerald-700) !important; }
.templo-push-btn-no { color: var(--jade-ink-soft) !important; border-color: var(--jade-line) !important; }

/* Cabeçalho mobile + dock inferior */
.templo-mobile-header {
    height: 68px !important;
    padding: 0 14px !important;
    color: var(--jade-ink) !important;
    background: rgba(255, 255, 255, .94) !important;
    border-bottom: 1px solid var(--jade-line) !important;
    box-shadow: 0 8px 28px rgba(6, 78, 59, .09) !important;
    backdrop-filter: blur(16px) saturate(150%);
}
.templo-mobile-header h2 { color: var(--emerald-950) !important; text-shadow: none !important; }
.templo-mobile-header img { border-color: var(--emerald-500) !important; box-shadow: 0 0 0 4px var(--emerald-100) !important; }
.templo-mobile-menu-btn {
    width: 44px !important;
    height: 44px !important;
    color: var(--emerald-900) !important;
    background: var(--emerald-50) !important;
    border: 1px solid var(--emerald-200) !important;
    border-radius: 13px !important;
    box-shadow: none !important;
}
.templo-mobile-overlay { background: rgba(4, 47, 46, .42) !important; }

.templo-mobile-dock {
    display: none;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 9996;
    min-height: 67px;
    padding: 7px;
    border: 1px solid rgba(167, 243, 208, .75);
    border-radius: 20px;
    background: rgba(4, 47, 46, .96);
    box-shadow: 0 18px 45px rgba(4, 47, 46, .25);
    backdrop-filter: blur(18px);
}
.templo-mobile-dock button {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 14px;
    color: #cce9dc;
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.templo-mobile-dock button span { display: block; margin-bottom: 3px; font-size: 20px; }
.templo-mobile-dock button.active { color: #fff; background: rgba(110, 231, 183, .17); }

/* Tema claro das páginas públicas */
.templo-light {
    --tl-bg-primary: var(--jade-bg) !important;
    --tl-bg-secondary: var(--emerald-50) !important;
    --tl-bg-card: #fff !important;
    --tl-bg-card-hover: #f7fdf9 !important;
    --tl-gold: var(--emerald-700) !important;
    --tl-gold-light: var(--emerald-500) !important;
    --tl-gold-dark: var(--emerald-900) !important;
    --tl-gold-soft: var(--emerald-200) !important;
    --tl-champagne: var(--emerald-50) !important;
    --tl-pearl: #f7fcf9 !important;
    --tl-ink: var(--jade-ink) !important;
    --tl-ink-soft: var(--jade-ink-soft) !important;
    --tl-ink-muted: var(--jade-muted) !important;
    --tl-ink-light: #6a817a !important;
    --tl-line: var(--jade-line) !important;
    --tl-line-soft: #e3f3eb !important;
}
.templo-light .app-nav-top,
.templo-light .app-nav-bottom,
.templo-light .nav-bottom {
    background: rgba(255, 255, 255, .94) !important;
    border-color: var(--jade-line) !important;
}
.templo-light .app-nav-btn { color: var(--emerald-900) !important; background: var(--emerald-50) !important; border-color: var(--emerald-200) !important; }
.templo-light .nav-item.active { color: var(--emerald-900) !important; background: var(--emerald-100) !important; }
.templo-light .templo-cadastro-card,
.templo-light .templo-consulta-card,
.templo-light .templo-login-card {
    border-color: var(--jade-line) !important;
    border-radius: 24px !important;
    box-shadow: var(--jade-shadow) !important;
}
.templo-light .templo-cadastro-card::before,
.templo-light .templo-consulta-card::before,
.templo-light .templo-login-card::before {
    background: linear-gradient(90deg, var(--emerald-900), var(--emerald-300), var(--emerald-900)) !important;
}
.templo-light .logo-glow::before,
.templo-light .templo-cadastro-logo,
.templo-light .templo-consulta-logo,
.templo-light .templo-login-logo { border-color: var(--emerald-500) !important; }
.templo-light .templo-btn-submit { letter-spacing: .07em !important; }

/* Página inicial standalone */
body.templo-portal-home {
    --bg-primary: var(--jade-bg);
    --bg-card: #fff;
    --bg-soft: var(--emerald-50);
    --pearl: #f7fcf9;
    --gold: var(--emerald-600);
    --gold-light: var(--emerald-300);
    --gold-dark: var(--emerald-900);
    --gold-soft: var(--emerald-200);
    --ink: var(--jade-ink);
    --ink-soft: var(--jade-ink-soft);
    --ink-muted: var(--jade-muted);
    --ink-light: #688078;
    --line: var(--jade-line);
    --line-soft: #e3f3eb;
    background: radial-gradient(circle at 100% 0%, rgba(110, 231, 183, .28), transparent 30rem), var(--jade-bg) !important;
}
body.templo-portal-home .nebula-1 { background: radial-gradient(circle, rgba(16,185,129,.28), transparent 70%) !important; }
body.templo-portal-home .nebula-2 { background: radial-gradient(circle, rgba(6,120,87,.18), transparent 70%) !important; }
body.templo-portal-home .nebula-3 { background: radial-gradient(circle, rgba(167,243,208,.38), transparent 70%) !important; }
body.templo-portal-home .ring-l { border-color: rgba(5,150,105,.18) !important; }
body.templo-portal-home .logo-aura { background: radial-gradient(circle, rgba(16,185,129,.28), transparent 65%) !important; }
body.templo-portal-home .logo-img { border-color: var(--emerald-600) !important; box-shadow: 0 0 0 8px rgba(16,185,129,.08), 0 16px 45px rgba(6,78,59,.12) !important; }
body.templo-portal-home .btn {
    border-color: var(--jade-line) !important;
    border-radius: 18px !important;
    box-shadow: var(--jade-shadow-soft) !important;
}
body.templo-portal-home .btn:hover { border-color: var(--emerald-300) !important; box-shadow: var(--jade-shadow) !important; }
body.templo-portal-home .btn-consulta {
    color: #fff !important;
    border-color: var(--emerald-900) !important;
    background: linear-gradient(135deg, var(--emerald-950), var(--emerald-700)) !important;
}
body.templo-portal-home .btn-consulta .btn-text p { color: #d9f5e8 !important; }
body.templo-portal-home .btn-consulta-badge { background: var(--emerald-500) !important; }
body.templo-portal-home .nav-bottom { background: rgba(255,255,255,.94) !important; border-color: var(--jade-line) !important; }
body.templo-portal-home .nav-item.active { color: var(--emerald-900) !important; background: var(--emerald-100) !important; }

/* Página de entrega do vídeo da consulta */
.cv-page {
    color: var(--jade-ink) !important;
    background: radial-gradient(circle at 50% 0%, rgba(110,231,183,.22), transparent 34rem), var(--jade-bg) !important;
}
.cv-page::before { background: radial-gradient(circle, rgba(16,185,129,.18), transparent 60%) !important; }
.cv-logo-wrap::before,
.cv-logo { border-color: var(--emerald-500) !important; }
.cv-logo { background: #fff !important; box-shadow: 0 8px 30px rgba(6,78,59,.16) !important; }
.cv-title,
.cv-saudacao h2 { color: var(--jade-ink) !important; }
.cv-subtitle,
.cv-saudacao .nome,
.cv-data,
.cv-divider { color: var(--emerald-800) !important; }
.cv-divider::before,
.cv-divider::after { background: linear-gradient(90deg, transparent, var(--emerald-300), transparent) !important; }
.cv-divider .diamond { background: var(--emerald-600) !important; }
.cv-card {
    color: var(--jade-ink) !important;
    background: #fff !important;
    border-color: var(--jade-line) !important;
    box-shadow: var(--jade-shadow) !important;
}
.cv-card::before { background: linear-gradient(90deg, transparent, var(--emerald-600), transparent) !important; }
.cv-saudacao { border-color: var(--jade-line) !important; }
.cv-saudacao p,
.cv-mensagem,
.cv-footer,
.cv-empty p { color: var(--jade-ink-soft) !important; }
.cv-mensagem {
    background: var(--emerald-50) !important;
    border-color: var(--emerald-600) !important;
}
.cv-btn-primary,
.cv-btn-iframe { color: #fff !important; background: linear-gradient(135deg, var(--emerald-800), var(--emerald-600)) !important; }
.cv-btn-secondary { color: var(--emerald-900) !important; border-color: var(--emerald-300) !important; background: #fff !important; }

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1100px) {
    .templo-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 900px) {
    body.templo-emerald { padding-bottom: 90px; }
    .templo-sidebar {
        width: min(86vw, 326px) !important;
        border-radius: 0 22px 22px 0;
    }
    .templo-main {
        margin-left: 0 !important;
        padding: 88px 14px 105px !important;
    }
    .templo-mobile-dock { display: flex; }
    .templo-attention-grid { grid-template-columns: 1fr; }
    .templo-push-banner { bottom: 92px !important; }
}

@media (max-width: 640px) {
    .templo-main { padding: 82px 10px 105px !important; }
    .templo-welcome { padding: 21px 18px !important; border-radius: 18px; }
    .templo-welcome h1 { font-size: 27px !important; }
    .templo-welcome p { position: relative; z-index: 1; font-size: 13px !important; }
    .templo-stats-grid { gap: 9px !important; }
    .templo-stat-card {
        min-height: 112px;
        padding: 14px 12px !important;
        align-items: flex-start !important;
        flex-direction: column;
        gap: 9px !important;
        border-radius: 16px !important;
    }
    .templo-stat-icon { width: 37px; height: 37px; flex-basis: 37px; font-size: 20px !important; border-radius: 11px; }
    .templo-stat-value { font-size: 22px !important; }
    .templo-stat-label { font-size: 11px !important; }
    .templo-card { padding: 16px !important; border-radius: 17px !important; }
    .templo-page-header { align-items: stretch !important; margin-bottom: 20px !important; }
    .templo-page-header h1 { text-align: left !important; font-size: 24px !important; }
    .templo-alerta-aniversario,
    .templo-alerta-pendentes,
    .templo-alerta-proxima-gira { min-height: 82px; padding: 14px 40px 14px 14px !important; }
    .templo-alerta-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 22px !important; }
    .templo-alerta-content strong { font-size: 11px !important; }
    .templo-alerta-content div { font-size: 12px !important; }
    .templo-grid-2 { grid-template-columns: 1fr !important; }
    .templo-field-row { display: grid !important; grid-template-columns: 1fr !important; gap: 0 !important; }
    .templo-field input,
    .templo-field select,
    .templo-field textarea,
    .templo-input { font-size: 16px !important; }
    .templo-section { padding: 16px !important; }
    .templo-form-progress { top: 74px; }
    .templo-tabs,
    .templo-ficha-tabs,
    .templo-chamada-tabs {
        display: flex !important;
        max-width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
    }
    .templo-tabs::-webkit-scrollbar,
    .templo-ficha-tabs::-webkit-scrollbar,
    .templo-chamada-tabs::-webkit-scrollbar { display: none; }
    .templo-tab { flex: 0 0 auto !important; min-width: 120px !important; }
    .templo-table-container {
        margin-inline: -5px;
        border-radius: 14px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .templo-table { min-width: 650px !important; }
    .templo-calendario { overflow-x: auto !important; }
    .templo-cal-header,
    .templo-cal-grid { min-width: 690px; }
    .templo-cal-day { min-height: 88px !important; }
    .templo-modal { align-items: flex-end !important; }
    .templo-modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        max-height: 94dvh !important;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
    }
    .templo-modal-actions {
        position: sticky !important;
        bottom: 0 !important;
        padding: 13px !important;
    }
    .templo-modal-body { padding: 16px !important; padding-bottom: 24px !important; }
    .templo-light .templo-cadastro-page,
    .templo-light .templo-consulta-page,
    .templo-light .templo-login-page { padding-inline: 10px !important; }
    .templo-light .templo-cadastro-card,
    .templo-light .templo-consulta-card,
    .templo-light .templo-login-card { padding: 23px 16px !important; border-radius: 19px !important; }
    body.templo-portal-home .main { padding: 62px 14px 100px !important; }
    body.templo-portal-home .logo-img { width: 108px !important; height: 108px !important; }
    body.templo-portal-home .logo-section { margin-bottom: 24px !important; }
    body.templo-portal-home .title { font-size: 23px !important; letter-spacing: 2px !important; }
    body.templo-portal-home .title span { font-size: 14px !important; letter-spacing: 4px !important; }
    body.templo-portal-home .ornament { margin: 18px 0 26px !important; }
    body.templo-portal-home .buttons { gap: 11px !important; }
    body.templo-portal-home .btn { min-height: 82px; padding: 14px !important; gap: 13px !important; }
    body.templo-portal-home .btn-icon { width: 47px !important; height: 47px !important; font-size: 23px !important; }
    body.templo-portal-home .btn-text h3 { font-size: 14px !important; letter-spacing: .06em !important; }
    body.templo-portal-home .btn-text p { font-size: 11px !important; }
}

@media (max-width: 380px) {
    .templo-mobile-header h2 { max-width: 150px !important; font-size: 10px !important; }
    .templo-main { padding-inline: 8px !important; }
    .templo-stat-card { padding: 12px 10px !important; }
    .templo-mobile-dock { left: 7px; right: 7px; bottom: calc(7px + env(safe-area-inset-bottom, 0px)); }
}

@media print {
    .templo-mobile-dock { display: none !important; }
    .templo-main { margin: 0 !important; padding: 20px !important; }
}
