:root {
    --ep-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --ep-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --ep-ink: #173c34;
    --ep-ink-deep: #102b25;
    --ep-ink-soft: #2f4039;
    --ep-muted: #586962;
    --ep-faint: #84948d;
    --ep-surface: #ffffff;
    --ep-paper: #f7f7f1;
    --ep-paper-hover: #efeee6;
    --ep-line: rgba(23, 60, 52, 0.09);
    --ep-line-strong: rgba(23, 60, 52, 0.16);
    --ep-gold: #866426;
    --ep-gold-bright: #c59b27;
    --ep-gold-soft: rgba(134, 100, 38, 0.10);
    --ep-gold-strong: rgba(197, 155, 39, 0.22);
    --ep-gold-border: rgba(134, 100, 38, 0.30);
    --ep-danger: #dc2626;
    --ep-danger-soft: rgba(220, 38, 38, 0.08);
    --ep-shadow-xs: 0 1px 2px rgba(16, 43, 37, 0.04);
    --ep-shadow-sm: 0 4px 20px -4px rgba(16, 43, 37, 0.06), 0 1px 3px rgba(16, 43, 37, 0.03);
    --ep-shadow-md: 0 14px 36px -10px rgba(16, 43, 37, 0.11), 0 2px 6px rgba(16, 43, 37, 0.04);
    --ep-shadow-popover: 0 20px 44px -10px rgba(16, 43, 37, 0.22), 0 4px 12px -2px rgba(16, 43, 37, 0.08);
    --ep-shadow-xl: 0 24px 48px -12px rgba(16, 43, 37, 0.24);
}

:root {
            --azul-noite: var(--ep-ink);
            --azul-card: #141f36;
            --ouro-primario: #b48a28;
            --ouro-escuro: #926f1c;
            --ouro-claro: #fdfaf3;
            --ouro-gradiente: linear-gradient(135deg, #d4af37 0%, #aa7c11 100%);
            --fundo-pergaminho: #fcfbf9;
            --fundo-pagina: var(--ep-paper);
            --texto-principal: #1e293b;
            --texto-suave: #64748b;
            --borda-fina: #e2e8f0;
            --sombra-card: 0 4px 14px rgba(12, 20, 39, 0.05);
            --sombra-premium: 0 10px 30px rgba(12, 20, 39, 0.08);
        }

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

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: var(--fundo-pagina);
            color: var(--texto-principal);
            line-height: 1.6;
            min-height: 100vh;
            min-height: 100dvh;
            display: flex;
            flex-direction: column;
            -webkit-font-smoothing: antialiased;
        }

        .banner-citacao {
            background: #ffffff;
            border-bottom: 1px solid var(--borda-fina);
            padding: 0.45rem 1rem;
            text-align: center;
            font-size: 0.78rem;
            color: var(--texto-suave);
            font-style: italic;
        }
        .banner-citacao span {
            color: var(--ouro-escuro);
            font-weight: 700;
            font-style: normal;
        }
        .banner-citacao a.dominio-oficial {
            color: var(--azul-noite);
            font-style: normal;
            font-weight: 700;
            text-decoration: none;
            margin-left: 0.6rem;
            font-size: 0.74rem;
            letter-spacing: 0.3px;
        }

        .navbar-ministerial {
            background-color: var(--azul-noite);
            border-bottom: 2px solid rgba(180, 138, 40, 0.4);
            padding: 0.85rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .navbar-marca {
            display: flex;
            align-items: center;
            gap: 0.85rem;
            text-decoration: none;
        }

        .logo-emblema {
            width: 38px;
            height: 38px;
            flex-shrink: 0;
            border: 1px solid rgba(180, 138, 40, 0.5);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #d4af37;
            font-family: 'Cinzel', serif;
            font-size: 1.3rem;
            font-weight: 700;
            background: rgba(255, 255, 255, 0.03);
        }

        .marca-titulos h1 {
            font-family: 'Cinzel', serif;
            font-size: 1.1rem;
            font-weight: 800;
            color: #ffffff;
            letter-spacing: 0.8px;
            margin: 0;
            line-height: 1.1;
        }

        .marca-titulos small {
            font-size: 0.63rem;
            color: #d4af37;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            display: block;
            margin-top: 2px;
        }

        .navbar-links {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 1.05rem;
        }

        .nav-link {
            color: #e2e8f0;
            text-decoration: none;
            font-size: 0.83rem;
            font-weight: 600;
            transition: color 0.2s, transform 0.2s;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            white-space: nowrap;
        }
        .nav-link:hover {
            color: #d4af37;
            transform: translateY(-1px);
        }

        .nav-link-story {
            color: #fde68a;
            border-left: 1px solid rgba(255, 255, 255, 0.12);
            padding-left: 1rem;
        }
        .nav-link-story:hover { color: #fbbf24; }

        .nav-link-kids {
            color: #bfdbfe;
            border-left: 1px solid rgba(255, 255, 255, 0.12);
            padding-left: 1rem;
        }
        .nav-link-kids:hover { color: #60a5fa; }

        .navbar-usuario {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.7rem;
            border-left: 1px solid rgba(255, 255, 255, 0.12);
            padding-left: 1.1rem;
        }

        .usuario-info {
            font-size: 0.8rem;
            color: #94a3b8;
        }
        .usuario-info strong { color: #ffffff; }
        .badge-papel {
            font-size: 0.65rem;
            padding: 0.15rem 0.5rem;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.08);
            color: #e2e8f0;
            margin-left: 0.25rem;
        }

        .btn-nav-secundario {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: #e2e8f0;
            padding: 0.35rem 0.75rem;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }
        .btn-nav-secundario:hover {
            border-color: #d4af37;
            color: #d4af37;
        }

        .form-logout {
            display: inline-flex;
            margin: 0;
        }

        .btn-sair {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #cbd5e1;
            padding: 0.35rem 0.8rem;
            border-radius: 6px;
            font-family: inherit;
            font-size: 0.78rem;
            font-weight: 600;
            line-height: 1.4;
            text-decoration: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            transition: all 0.2s;
        }
        .btn-sair:hover {
            background: rgba(239, 68, 68, 0.15);
            border-color: #ef4444;
            color: #ffffff;
        }

        .btn-admin-provisionar {
            background: rgba(180, 138, 40, 0.18);
            border: 1px solid rgba(212, 175, 55, 0.55);
            color: #d4af37;
            padding: 0.35rem 0.85rem;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 700;
            text-decoration: none;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }
        .btn-admin-provisionar:hover {
            background: var(--ouro-primario);
            color: var(--azul-noite);
        }

        .mensagens-globais {
            margin-bottom: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }
        .alerta-global {
            padding: 0.85rem 1.2rem;
            border-radius: 8px;
            background: #ffffff;
            border: 1px solid var(--borda-fina);
            border-left: 4px solid var(--ouro-primario);
            font-size: 0.88rem;
            font-weight: 500;
            box-shadow: var(--sombra-card);
        }
        .alerta-global.success {
            border-left-color: #16a34a;
            background: #f0fdf4;
            color: #166534;
        }
        .alerta-global.error {
            border-left-color: #dc2626;
            background: #fef2f2;
            color: #991b1b;
        }

        .conteudo-principal {
            max-width: 1280px;
            width: 100%;
            margin: 2rem auto;
            padding: 0 1.5rem;
            flex-grow: 1;
        }

        .rodape-institucional {
            background: #ffffff;
            border-top: 1px solid var(--borda-fina);
            padding: 1rem 1.5rem;
            text-align: center;
            font-size: 0.76rem;
            color: var(--texto-suave);
        }
        .rodape-institucional a {
            color: var(--azul-noite);
            font-weight: 700;
            text-decoration: none;
        }

        /* =========================================================================
           SISTEMA GLOBAL DE TOAST & MODAL EDITORIAL (AAA)
           ========================================================================= */
        .ep-toast-stack {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 99999;
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
            max-width: 390px;
            width: calc(100vw - 32px);
            pointer-events: none;
        }

        .ep-toast {
            pointer-events: auto;
            background: var(--azul-noite);
            color: #f8fafc;
            border: 1px solid rgba(212, 175, 55, 0.45);
            border-left: 4px solid #d4af37;
            border-radius: 12px;
            padding: 0.9rem 1.05rem;
            box-shadow: 0 18px 36px -10px rgba(12, 20, 39, 0.45);
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            opacity: 0;
            transform: translateY(14px);
            transition: opacity 0.22s ease, transform 0.22s ease;
        }

        .ep-toast.visivel {
            opacity: 1;
            transform: translateY(0);
        }

        .ep-toast.erro {
            border-left-color: #ef4444;
        }

        .ep-toast.aviso {
            border-left-color: #f59e0b;
        }

        .ep-toast-icone {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background: rgba(212, 175, 55, 0.16);
            color: #f3d27a;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .ep-toast.erro .ep-toast-icone {
            background: rgba(239, 68, 68, 0.18);
            color: #fca5a5;
        }

        .ep-toast.aviso .ep-toast-icone {
            background: rgba(245, 158, 11, 0.18);
            color: #fcd34d;
        }

        .ep-toast-corpo {
            flex: 1;
            min-width: 0;
        }

        .ep-toast-titulo {
            font-family: 'Cinzel', serif;
            font-size: 0.82rem;
            font-weight: 700;
            color: #f3d27a;
            margin-bottom: 0.18rem;
        }

        .ep-toast.erro .ep-toast-titulo {
            color: #fca5a5;
        }

        .ep-toast.aviso .ep-toast-titulo {
            color: #fcd34d;
        }

        .ep-toast-msg {
            font-size: 0.82rem;
            color: #e2e8f0;
            line-height: 1.45;
        }

        .ep-toast-link {
            display: inline-block;
            margin-top: 0.45rem;
            font-size: 0.76rem;
            font-weight: 700;
            color: #f3d27a;
            text-decoration: underline;
        }

        .ep-toast-fechar {
            background: transparent;
            border: none;
            color: #94a3b8;
            font-size: 1.05rem;
            line-height: 1;
            cursor: pointer;
            padding: 0 0.2rem;
        }

        .ep-toast-fechar:hover {
            color: #ffffff;
        }

        .ep-modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(12, 20, 39, 0.6);
            backdrop-filter: blur(3px);
            z-index: 99998;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .ep-modal-backdrop[hidden] {
            display: none !important;
        }

        .ep-modal-box {
            background: #fffefa;
            border: 1px solid rgba(180, 138, 40, 0.3);
            border-top: 4px solid #c59b27;
            border-radius: 16px;
            width: 100%;
            max-width: 430px;
            padding: 1.55rem 1.7rem;
            box-shadow: 0 24px 48px -12px rgba(12, 20, 39, 0.35);
        }

        .ep-modal-box.perigo {
            border-top-color: #dc2626;
        }

        .ep-modal-box h4 {
            font-family: 'Cinzel', serif;
            font-size: 1.06rem;
            color: var(--azul-noite);
            margin-bottom: 0.45rem;
        }

        .ep-modal-box p {
            font-size: 0.86rem;
            color: #475569;
            line-height: 1.55;
            margin-bottom: 1.25rem;
        }

        .ep-modal-acoes {
            display: flex;
            justify-content: flex-end;
            gap: 0.6rem;
            flex-wrap: wrap;
        }

        .ep-btn-cancelar {
            padding: 0.52rem 1rem;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            background: #ffffff;
            color: #334155;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
        }

        .ep-btn-confirmar {
            padding: 0.52rem 1.15rem;
            border-radius: 8px;
            border: none;
            background: var(--azul-noite);
            color: #f3d27a;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 700;
            text-decoration: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
        }

        .ep-modal-box.perigo .ep-btn-confirmar {
            background: #dc2626;
            color: #ffffff;
        }

        @media (max-width: 1120px) {
            .navbar-ministerial { padding: 0.85rem 1.25rem; }
            .navbar-usuario { border-left: none; padding-left: 0; }
        }
        @media (max-width: 640px) {
            .navbar-links {
                width: 100%;
                justify-content: flex-start;
                gap: 0.85rem;
                padding-top: 0.5rem;
                border-top: 1px solid rgba(255, 255, 255, 0.08);
            }
            .nav-link-story, .nav-link-kids { border-left: none; padding-left: 0; }
            .conteudo-principal { margin: 1.25rem auto; padding: 0 1rem; }
        }
        @media print {
            .no-print { display: none !important; }
        }

.ep-recuperacao { max-width: 32rem; margin: 3rem auto; padding: 2rem; background: var(--ep-surface); border: 1px solid var(--ep-line-strong); border-radius: 1rem; }
.ep-recuperacao input { display: block; width: 100%; box-sizing: border-box; padding: .75rem; margin: .4rem 0; }
.ep-recuperacao button { background: var(--ep-ink); color: white; border: 0; border-radius: .4rem; padding: .7rem 1.1rem; }
.ep-recuperacao a { display: inline-block; margin-top: 1rem; color: var(--ep-ink); }
