:root {
    color-scheme: light;
    --orbe-purple: #713a9a;
    --orbe-dark: #11001c;
    --orbe-white: #fcf7ff;
    --canvas: #f8f6fa;
    --surface: #fff;
    --ink: #261630;
    --muted: #675b70;
    --line: #e9e2ee;
    --accent-wash: #f4ebfa;
    --shell: #1f102b;
    --shell-ink: #e5d8ed;
    --shell-muted: #bca7ca;
    --sidebar-width: 15.5rem;
    --topbar-height: 4.25rem;
    --primary-fill: #713a9a;
    --primary-fill-hover: #532870;
    --orbe-purple-hover: #532870;
    --control-line: #d9cfdf;
    --accent-line: #d9c8e5;
    --focus-shadow: #713a9a24;
    --main-rgb: 113, 58, 154;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 100%;
}

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

body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.5; }
:where(.dashboard-shell, .login-panel) a { color: inherit; text-decoration: none; }
button { font: inherit; }
.page-header h1, .page-header p, .topbar p, .sidebar p, .catalog-panel h2, .catalog-panel p, .module-panel h2 { margin: 0; }
.sidebar ul, .module-panel ul { margin: 0; padding: 0; list-style: none; }

::selection { background: #dfc4f0; color: var(--orbe-dark); }

:focus-visible {
    outline: 2px solid var(--orbe-purple);
    outline-offset: 3px;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skip-link {
    position: fixed;
    z-index: 10;
    top: .75rem;
    left: .75rem;
    padding: .55rem .9rem;
    transform: translateY(-200%);
    background: var(--surface);
    color: var(--orbe-dark);
    border-radius: .35rem;
}

.skip-link:focus { transform: none; }

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template: "sidebar topbar" var(--topbar-height) "sidebar main" 1fr / var(--sidebar-width) minmax(0, 1fr);
}

.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-context {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--muted);
    font-size: .8125rem;
}

.topbar-context > .icon { color: #897994; width: .75rem; height: .75rem; }
.topbar-context > a:hover { color: var(--orbe-purple); text-decoration: underline; }
.topbar-current { font-weight: 600; color: var(--ink); }

.site-link, .catalog-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 2.75rem;
    padding-inline: .9rem;
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 150ms, color 150ms;
}

.site-link { flex: none; border: 1px solid var(--line); color: var(--orbe-purple); }
.site-link:hover { background: var(--accent-wash); }
.site-link .icon { width: 1rem; height: 1rem; }

.menu-toggle, .sidebar-close {
    display: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--shell);
    color: var(--shell-ink);
}

.sidebar :focus-visible, .catalog-panel :focus-visible { outline-color: #d8a8f5; }

.sidebar-brand {
    min-height: var(--topbar-height);
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1.25rem .8rem 1.5rem;
    border-bottom: 1px solid #ffffff18;
}

.sidebar-brand a { display: inline-flex; }
.sidebar-brand img { width: 8.7rem; height: auto; }

.sidebar-nav { padding: 1.1rem .75rem 1.25rem; }

.nav-group { margin-top: 1.15rem; }

.nav-title {
    margin: 0 0 .3rem .75rem;
    color: var(--shell-muted);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 2.75rem;
    padding: .45rem .75rem;
    border-radius: .45rem;
    font-size: .8125rem;
    font-weight: 500;
    transition: background-color 150ms, color 150ms;
}

.sidebar-link .icon { color: var(--shell-muted); }
.sidebar-link:hover { background: #ffffff12; color: #fff; }

.sidebar-link[aria-current="page"] {
    background: #4a2760;
    color: #fff;
    font-weight: 600;
}

.sidebar-link[aria-current="page"] .icon { color: #f1d7ff; }

.sidebar-account {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: auto;
    padding: .85rem .8rem .85rem 1.1rem;
    border-top: 1px solid #ffffff18;
}

.account-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #513069;
    color: #fbebff;
    font-size: .8125rem;
    font-weight: 700;
}

.account-name { color: var(--orbe-white); font-size: .8125rem; font-weight: 500; }

.sidebar-account form { margin: 0 0 0 auto; }

.logout-link {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: .45rem;
    color: var(--shell-muted);
}

.logout-link:hover, .sidebar-close:hover { background: #ffffff12; color: #fff; }

.dashboard-main { grid-area: main; padding: 2.25rem 2rem 3.25rem; }
.dashboard-content { max-width: 82rem; margin-inline: auto; }

.admin-password-notice {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border: 1px solid var(--accent-line);
    border-radius: .65rem;
    background: var(--accent-wash);
    color: var(--ink);
    font-size: .875rem;
}

.admin-password-notice .icon { flex: none; margin-top: .16rem; color: var(--orbe-purple); }
.admin-password-notice p { margin: .15rem 0 0; }
.admin-password-notice a { display: inline-block; margin-top: .35rem; color: var(--orbe-purple); font-weight: 650; text-underline-offset: .2em; }

.password-panel {
    max-width: 32rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: .875rem;
    background: var(--surface);
}
.password-account { display: grid; gap: .2rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .875rem; }
.password-account strong { color: var(--ink); overflow-wrap: anywhere; }
.password-panel .form-label { font-weight: 600; }
.password-panel .form-control { min-height: 2.75rem; font-size: 1rem; }
.password-panel .btn { min-height: 2.75rem; }
@media (max-width: 600px) {
    .password-panel .btn { width: 100%; }
}
.page-header { margin-bottom: 1.55rem; }
.page-header h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.page-header p { margin-top: .4rem; color: var(--muted); font-size: .9375rem; }

.catalog-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    overflow: hidden;
    min-height: 10rem;
    padding: 1.65rem 1.8rem;
    border-radius: .875rem;
    background: linear-gradient(110deg, #261134 0%, #44215a 62%, #5b2a74 100%);
    color: var(--orbe-white);
}

.catalog-copy { display: flex; align-items: center; gap: 1rem; }
.catalog-copy h2 { font-size: 1.375rem; line-height: 1.22; font-weight: 700; letter-spacing: -.025em; }
.catalog-copy p { margin-top: .35rem; color: #ebd9f3; font-size: .875rem; }

.catalog-icon, .module-icon {
    display: grid;
    place-items: center;
    flex: none;
    border-radius: .6rem;
}

.catalog-icon {
    width: 3.15rem;
    height: 3.15rem;
    background: #ffffff19;
    border: 1px solid #ffffff39;
    color: #f5e3ff;
}

.catalog-icon .icon { width: 1.5rem; height: 1.5rem; }

.catalog-link { background: var(--orbe-white); color: #462058; }
.catalog-link:hover { background: #edd9f8; }
.catalog-link .icon { width: 1rem; height: 1rem; }

.catalog-orbit {
    position: absolute;
    z-index: -1;
    inset: 0 0 0 auto;
    width: min(43%, 28rem);
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, black 38%);
}

.catalog-orbit span {
    position: absolute;
    top: -3.1rem;
    right: -5rem;
    width: 29rem;
    height: 15rem;
    border: 1px solid #e6bfff54;
    border-radius: 50%;
    transform: rotate(-28deg);
}

.catalog-orbit span:nth-child(2) { top: -1rem; right: -4rem; }
.catalog-orbit span:nth-child(3) { top: 1.1rem; right: -3rem; }

.modules-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    margin-top: 1.6rem;
}

.module-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .875rem;
}

.module-panel > header { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.module-panel h2 { font-size: 1rem; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; }
.module-panel > ul { padding-inline: .65rem; }
.module-panel li + li { border-top: 1px solid var(--line); }

.module-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    min-height: 4.65rem;
    margin-block: .24rem;
    padding: .6rem .55rem;
    border-radius: .55rem;
    transition: background-color 150ms;
}

.module-link:hover { background: var(--accent-wash); }
.module-link:focus-visible { outline-offset: -2px; }

.module-icon {
    width: 2.35rem;
    height: 2.35rem;
    background: var(--accent-wash);
    color: var(--orbe-purple);
}

.module-copy { display: grid; gap: .17rem; }
.module-copy strong { font-size: .875rem; font-weight: 600; }
.module-copy > span { font-size: .8125rem; line-height: 1.4; color: var(--muted); }
.module-link > .icon { color: var(--muted); width: 1rem; height: 1rem; }
.module-link:hover > .icon { color: var(--orbe-purple); }

@media (max-width: 1000px) {
    .modules-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
    .dashboard-shell { grid-template: "topbar" var(--topbar-height) "sidebar" auto "main" 1fr / minmax(0, 1fr); }
    .dashboard-main { padding: 1.65rem 1rem 2rem; }
    .topbar { padding-inline: 1rem; }
    .topbar-context { gap: .4rem; }
    .topbar-context > .icon, .topbar-context > a { display: none; }
    .menu-toggle:not([hidden]), .sidebar[popover] .sidebar-close { display: grid; }
    .menu-toggle { margin-left: -.4rem; color: var(--orbe-purple); }
    .menu-toggle:hover { background: var(--accent-wash); }
    .sidebar { position: static; height: auto; }
    .sidebar[popover] {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(19rem, calc(100% - 2.5rem));
        max-width: none;
        height: 100dvh;
        max-height: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .sidebar[popover]:not(:popover-open) { display: none; }
    .sidebar::backdrop { background: #11001ca0; }
    .sidebar-brand { padding-right: .7rem; }
    .catalog-panel { padding: 1.3rem; }
    .modules-grid { gap: 1rem; margin-top: 1.2rem; }
}

@media (max-width: 520px) {
    .catalog-panel { flex-direction: column; align-items: flex-start; }
    .catalog-copy { align-items: flex-start; gap: .75rem; }
    .catalog-copy h2 { font-size: 1.2rem; }
    .catalog-icon { width: 2.6rem; height: 2.6rem; }
    .catalog-icon .icon { width: 1.25rem; height: 1.25rem; }
    .catalog-orbit { width: 68%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* Formulários e páginas de trabalho do painel */
.admin-workspace {
    --bs-body-font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bs-body-color: var(--ink);
    --bs-secondary-color: var(--muted);
    --bs-primary-rgb: var(--main-rgb);
    --bs-border-color: var(--line);
    --bs-link-color: var(--orbe-purple);
    --bs-link-color-rgb: var(--main-rgb);
    --bs-link-hover-color-rgb: 83, 40, 112;
    background: var(--canvas);
}

.admin-workspace .btn {
    --bs-btn-border-radius: .5rem;
    font-size: .875rem;
    font-weight: 600;
}

.admin-workspace .btn:not(.btn-sm) { min-height: 2.75rem; }
.admin-workspace .btn > .icon { vertical-align: -.19em; }

.admin-workspace .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-fill);
    --bs-btn-border-color: var(--primary-fill);
    --bs-btn-hover-bg: var(--primary-fill-hover);
    --bs-btn-hover-border-color: var(--primary-fill-hover);
    --bs-btn-active-bg: var(--primary-fill-hover);
    --bs-btn-active-border-color: var(--primary-fill-hover);
    --bs-btn-focus-shadow-rgb: var(--main-rgb);
    --bs-btn-disabled-bg: var(--primary-fill);
    --bs-btn-disabled-border-color: var(--primary-fill);
}

.admin-workspace .btn-outline-primary {
    --bs-btn-color: var(--orbe-purple);
    --bs-btn-border-color: var(--accent-line);
    --bs-btn-hover-color: var(--orbe-purple-hover);
    --bs-btn-hover-bg: var(--accent-wash);
    --bs-btn-hover-border-color: var(--accent-line);
    --bs-btn-active-color: var(--orbe-purple-hover);
    --bs-btn-active-bg: var(--accent-wash);
    --bs-btn-active-border-color: var(--orbe-purple);
    --bs-btn-focus-shadow-rgb: var(--main-rgb);
}

.admin-workspace .form-control,
.admin-workspace .form-select,
.admin-workspace .input-group-text {
    border-color: var(--control-line);
    border-radius: .5rem;
    font-size: .875rem;
}

.admin-workspace .form-select,
.admin-workspace .form-control:not(.form-control-sm, textarea) { min-height: 2.65rem; }

.admin-workspace :is(.form-control, .form-select, .form-check-input):focus {
    border-color: var(--orbe-purple);
    box-shadow: 0 0 0 .2rem var(--focus-shadow);
}

.admin-workspace .form-check-input:checked { background-color: var(--primary-fill); border-color: var(--primary-fill); }
.admin-workspace .form-label { font-size: .875rem; font-weight: 500; }
.admin-workspace .form-text { color: var(--muted); }
.admin-workspace .text-purple { color: var(--orbe-purple); }
.admin-workspace .card { --bs-card-border-radius: .875rem; --bs-card-border-color: var(--line); }
.admin-workspace .card-header { background-color: var(--surface); color: var(--ink); }
.admin-workspace .list-group-flush { border-radius: inherit; overflow: hidden; }

.page-header-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .9rem 1rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-section-title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; }
.admin-section-divider { margin: 1.5rem 0 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.admin-settings-form { padding: clamp(1rem, 3vw, 1.75rem); max-width: 60rem; }
.admin-form-actions { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.admin-account-action { max-width: 40rem; padding: 1.25rem; }

.admin-workspace .accordion {
    --bs-accordion-border-radius: .875rem;
    --bs-accordion-inner-border-radius: calc(.875rem - 1px);
    --bs-accordion-active-bg: var(--accent-wash);
    --bs-accordion-active-color: var(--orbe-purple-hover);
    --bs-accordion-btn-focus-box-shadow: inset 0 0 0 2px var(--orbe-purple);
}

.admin-workspace .accordion .accordion-item { border: 1px solid var(--line); border-radius: .875rem; }
.admin-workspace .accordion-button { font-size: .925rem; font-weight: 650; }
.admin-subcategory { background: var(--canvas); }
.avatar-preview { width: 5rem; height: 5rem; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }

.banner-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .8rem;
}
.banner-thumb { width: clamp(3rem, 8vw, 5rem); aspect-ratio: 16 / 9; object-fit: cover; border-radius: .4rem; background: var(--canvas); }
.banner-list-text { overflow-wrap: anywhere; }
.banner-actions { display: flex; align-items: center; gap: .3rem; }
.section-preview {
    display: grid;
    place-items: center;
    height: 5.75rem;
    border: 1px dashed var(--accent-line);
    border-radius: .6rem;
    overflow: hidden;
    background: var(--canvas);
    font-size: .75rem;
    color: var(--muted);
    text-align: center;
}
.section-preview img { width: 100%; height: 100%; object-fit: cover; }

.admin-login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.25rem;
    background: var(--canvas);
}

.login-panel {
    width: min(100%, 26rem);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .875rem;
}

.login-brand { display: flex; align-items: center; min-height: 4.75rem; padding: 1rem 1.5rem; background: var(--shell); }
.login-brand img { width: 8.7rem; height: auto; }
.login-content { padding: clamp(1.1rem, 5vw, 1.6rem); }
.login-content .page-header h1 { font-size: 1.5rem; }
.login-back { display: inline-block; margin-top: 1.25rem; font-size: .875rem; }
.login-back:hover { color: var(--orbe-purple); text-decoration: underline; }

/* Aparência e idioma */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --canvas: #15111c;
    --surface: #21192a;
    --ink: #f3eaf7;
    --muted: #c4b5cc;
    --line: #3c2e49;
    --accent-wash: #33213f;
    --shell: #190e23;
    --shell-ink: #e8daee;
    --shell-muted: #c4b0d1;
    --orbe-purple: #d8b6ee;
    --orbe-purple-hover: #f1dafd;
    --primary-fill: #8650a8;
    --primary-fill-hover: #754292;
    --control-line: #574462;
    --accent-line: #654f75;
    --focus-shadow: #d8b6ee38;
    --main-rgb: 216, 182, 238;
}

[data-bs-theme="dark"] .admin-workspace {
    --bs-body-bg: var(--surface);
    --bs-link-hover-color-rgb: 241, 218, 253;
    --bs-tertiary-bg: #292035;
    --bs-light-rgb: 41, 32, 53;
}

[data-bs-theme="dark"] .admin-workspace .bg-white { background-color: var(--surface) !important; }
[data-bs-theme="dark"] .admin-workspace .btn-light {
    --bs-btn-bg: var(--accent-wash);
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-border-color: var(--control-line);
}
[data-bs-theme="dark"] .catalog-panel { background: linear-gradient(110deg, #30203d, #472658 65%, #573168); }

.topbar-actions, .preference-controls {
    display: flex;
    flex: none;
    align-items: center;
    gap: .5rem;
}

.language-control, .theme-toggle {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0 .55rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--surface);
    color: var(--muted);
    font-family: inherit;
    font-size: .75rem;
    font-weight: 650;
    cursor: pointer;
}

.language-control:hover, .theme-toggle:hover { background: var(--accent-wash); color: var(--orbe-purple); }
.language-control .icon, .theme-toggle .icon { width: 1rem; height: 1rem; }
.theme-toggle span { display: grid; place-items: center; }

.language-control select {
    position: absolute;
    inset: 0;
    width: 100%;
    font-size: 1rem;
    opacity: 0;
    cursor: pointer;
}

.language-control:focus-within {
    outline: 2px solid var(--orbe-purple);
    outline-offset: 3px;
}

.theme-toggle .theme-sun, [data-bs-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-bs-theme="dark"] .theme-toggle .theme-sun { display: grid; }

.mobile-brand, .sidebar-site-link { display: none; }
.login-brand { justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.login-brand :is(.language-control, .theme-toggle) {
    color: var(--shell-ink);
    border-color: #ffffff26;
    background: #ffffff0b;
}
.login-brand :is(.language-control, .theme-toggle):hover { background: #ffffff1e; }

@media (max-width: 760px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: .25rem;
        padding-inline: .7rem;
    }
    .topbar-current, .topbar-actions .site-link { display: none; }
    .topbar-context { grid-column: 1; }
    .topbar-actions { grid-column: 3; justify-self: end; }
    .topbar-actions .preference-controls { gap: .25rem; }
    .topbar :is(.language-control, .theme-toggle),
    .login-brand :is(.language-control, .theme-toggle) {
        padding-inline: .35rem;
        border: 0;
        background: transparent;
    }
    .topbar :is(.language-control, .theme-toggle):is(:hover, :active) { background: var(--accent-wash); }
    .topbar .language-control .icon { width: .9rem; }
    .mobile-brand { display: inline-flex; grid-column: 2; align-items: center; }
    .mobile-brand img { display: block; width: 6.05rem; height: auto; filter: brightness(0); opacity: .9; }
    [data-bs-theme="dark"] .mobile-brand img { filter: none; opacity: 1; }
    .sidebar-site-link { display: flex; margin: 0 .75rem .7rem; }
}
