:root { --pmh-height: 72px; }
body.pmh-active,
body.admin-bar.pmh-active { padding-top: 0 !important; }
body.pmh-classroom .sala-de-aula-widget {
    margin-top: calc(var(--pmh-height) + 24px);
}
body.pmh-community-page .pmc-page-grid {
    padding-top: calc(var(--pmh-height) + 30px);
}

.pmh {
    --pmh-bg: rgba(10, 12, 17, .66);
    --pmh-surface: #181b22;
    --pmh-surface-2: #222630;
    --pmh-text: #f4f5f7;
    --pmh-muted: #9399a6;
    --pmh-border: rgba(255,255,255,.09);
    --pmh-primary: #3ea6ff;
    --pmh-primary-2: #9a5cff;
    position: fixed; z-index: 99980; top: 0; left: 0; right: 0; height: var(--pmh-height);
    color: var(--pmh-text); background: var(--pmh-bg); border-bottom: 1px solid var(--pmh-border);
    box-shadow: 0 8px 32px rgba(0,0,0,.12); backdrop-filter: blur(20px) saturate(135%); -webkit-backdrop-filter: blur(20px) saturate(135%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left; -webkit-font-smoothing: antialiased;
}
.admin-bar .pmh { top: 32px; }
.pmh-theme-claro .pmh {
    --pmh-bg: rgba(255,255,255,.72);
    --pmh-surface: #fff;
    --pmh-surface-2: #f2f4f8;
    --pmh-text: #171923;
    --pmh-muted: #687080;
    --pmh-border: rgba(15,23,42,.1);
    box-shadow: 0 9px 30px rgba(15,23,42,.09);
}
.pmh, .pmh *, .pmh *::before, .pmh *::after { box-sizing: border-box; }
.pmh a { text-decoration: none !important; }
.pmh button, .pmh input { font: inherit !important; text-transform: none !important; letter-spacing: normal !important; }
.pmh-inner {
    width: min(1240px, calc(100% - 40px)); height: 100%; margin: 0 auto;
    display: grid; grid-template-columns: minmax(150px, 1fr) minmax(260px, 520px) minmax(150px, 1fr);
    align-items: center; gap: 28px;
}
.pmh-brand { display: inline-flex; align-items: center; justify-self: start; min-width: 0; color: var(--pmh-text) !important; }
.pmh-brand img { display: block; width: auto; max-width: 180px; height: 42px; object-fit: contain; }
.pmh-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pmh-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px;
    margin-right: 10px; border-radius: 12px; background: linear-gradient(135deg,var(--pmh-primary),var(--pmh-primary-2));
    color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 0 24px rgba(62,166,255,.22);
}
.pmh-search { position: relative; width: 100%; }
.pmh-search > svg {
    position: absolute; z-index: 2; left: 14px; top: 50%; width: 18px; height: 18px;
    transform: translateY(-50%); color: var(--pmh-muted); pointer-events: none;
}
.pmh-search input {
    display: block; width: 100%; height: 42px; margin: 0 !important; padding: 0 42px !important;
    border: 1px solid var(--pmh-border) !important; border-radius: 13px !important;
    outline: none !important; background: var(--pmh-surface) !important; color: var(--pmh-text) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important; font-size: 13px !important;
}
.pmh-search input::placeholder { color: var(--pmh-muted); opacity: 1; }
.pmh-search input:focus { border-color: color-mix(in srgb,var(--pmh-primary) 65%,transparent) !important; box-shadow: 0 0 0 3px color-mix(in srgb,var(--pmh-primary) 14%,transparent) !important; }
.pmh-results {
    position: absolute; z-index: 20; top: 50px; left: 0; right: 0; max-height: min(420px,70vh); overflow-y: auto;
    padding: 7px; border: 1px solid var(--pmh-border); border-radius: 16px; background: var(--pmh-surface);
    box-shadow: 0 24px 60px rgba(0,0,0,.38);
}
.pmh-result {
    display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 8px 10px;
    border-radius: 11px; color: var(--pmh-text) !important;
}
.pmh-result:hover, .pmh-result.is-active { background: var(--pmh-surface-2); }
.pmh-result-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px;
    border-radius: 10px; background: color-mix(in srgb,var(--pmh-primary) 13%,transparent); color: var(--pmh-primary);
}
.pmh-result-icon svg { width: 17px; height: 17px; }
.pmh-result span { min-width: 0; }
.pmh-result strong, .pmh-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmh-result strong { font-size: 13px; font-weight: 700; }
.pmh-result small { margin-top: 2px; color: var(--pmh-muted); font-size: 11px; }
.pmh-empty { padding: 22px 14px; color: var(--pmh-muted); text-align: center; font-size: 13px; }
.pmh-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.pmh-icon, .pmh-mobile-search {
    display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px;
    padding: 0 !important; border: 1px solid transparent !important; border-radius: 12px !important;
    background: transparent !important; color: var(--pmh-muted) !important; box-shadow: none !important;
}
.pmh-icon:hover, .pmh-mobile-search:hover { border-color: var(--pmh-border) !important; background: var(--pmh-surface) !important; color: var(--pmh-text) !important; }
.pmh-icon svg, .pmh-mobile-search svg { width: 20px; height: 20px; }
.pmh-community { color: #df6cff !important; }
.pmh-community.is-active { border-color: rgba(223,108,255,.28) !important; background: rgba(223,108,255,.1) !important; }
.pmh-notifications { position: relative; }
.pmh-bell { position: relative; cursor: pointer; }
.pmh-bell-count {
    position: absolute; top: -3px; right: -3px; display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--pmh-bg); border-radius: 999px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; line-height: 1;
}
.pmh-bell-count[hidden] { display: none !important; }
.pmh-notification-panel {
    position: absolute; z-index: 35; top: 55px; right: -56px; width: min(390px,calc(100vw - 24px));
    max-height: min(560px,calc(100vh - 100px)); overflow: auto; border: 1px solid var(--pmh-border);
    border-radius: 17px; background: var(--pmh-surface); box-shadow: 0 24px 65px rgba(0,0,0,.42);
}
.pmh-notification-panel[hidden] { display: none !important; }
.pmh-notification-head { padding: 15px 16px 12px; border-bottom: 1px solid var(--pmh-border); font-size: 14px; }
.pmh-notification-body { padding: 7px; }
.pmh-notification-empty { padding: 24px 14px; color: var(--pmh-muted); text-align: center; font-size: 13px; }
.pmh-enable-notifications {
    display: block; width: calc(100% - 8px); min-height: 38px; margin: 4px 4px 8px; padding: 0 13px;
    border: 1px solid color-mix(in srgb,var(--pmh-primary) 38%,var(--pmh-border)); border-radius: 11px;
    background: color-mix(in srgb,var(--pmh-primary) 11%,var(--pmh-surface)) !important;
    color: var(--pmh-primary) !important; cursor: pointer; font-size: 12px !important; font-weight: 700 !important;
}
.pmh-notification-item {
    display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px;
    min-height: 58px; padding: 9px 10px; border-radius: 11px; color: var(--pmh-text) !important;
}
.pmh-notification-item:hover { background: var(--pmh-surface-2); }
.pmh-notification-item.is-unread { background: color-mix(in srgb,var(--pmh-primary) 9%,var(--pmh-surface)); }
.pmh-notification-visual {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border-radius: 12px; overflow: hidden; background: color-mix(in srgb,var(--pmh-primary) 14%,var(--pmh-surface-2)); color: var(--pmh-primary);
}
.pmh-notification-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pmh-notification-visual svg { width: 20px; height: 20px; }
.pmh-notification-item strong,
.pmh-notification-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.pmh-notification-item strong { color: var(--pmh-text); font-size: 12px; line-height: 1.35; }
.pmh-notification-item small { margin-top: 2px; color: var(--pmh-muted); font-size: 11px; line-height: 1.35; }
.pmh-user { position: relative; }
.pmh-user-button {
    display: flex !important; align-items: center; gap: 9px; max-width: 200px; min-height: 46px; padding: 3px 5px 3px 4px !important;
    border: 1px solid transparent !important; border-radius: 14px !important; outline: none !important;
    background: transparent !important; color: var(--pmh-text) !important; box-shadow: none !important; cursor: pointer;
}
.pmh-user-button:hover, .pmh-user-button[aria-expanded="true"] { border-color: var(--pmh-border) !important; background: var(--pmh-surface) !important; }
.pmh-user-button > svg { width: 16px; height: 16px; color: var(--pmh-muted); transition: transform .15s; }
.pmh-user-button[aria-expanded="true"] > svg { transform: rotate(180deg); }
.pmh-avatar { display: block; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,255,255,.09); }
.pmh-user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
.pmh-menu {
    position: absolute; z-index: 30; top: 55px; right: 0; width: 270px; padding: 8px;
    border: 1px solid var(--pmh-border); border-radius: 17px; background: var(--pmh-surface);
    box-shadow: 0 24px 65px rgba(0,0,0,.42);
}
.pmh-menu-head { display: flex; align-items: center; gap: 11px; margin: 2px 2px 7px; padding: 8px 8px 13px; border-bottom: 1px solid var(--pmh-border); }
.pmh-menu-head span { min-width: 0; }
.pmh-menu-head strong, .pmh-menu-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmh-menu-head strong { font-size: 13px; }
.pmh-menu-head small { margin-top: 2px; color: var(--pmh-muted); font-size: 11px; }
.pmh-menu > a {
    display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 10px;
    color: var(--pmh-text) !important; font-size: 13px; font-weight: 600;
}
.pmh-menu > a:hover { background: var(--pmh-surface-2); }
.pmh-menu > a svg { width: 18px; height: 18px; color: var(--pmh-muted); }
.pmh-menu > .pmh-logout { margin-top: 4px; border-top: 1px solid var(--pmh-border); border-radius: 0 0 10px 10px; color: #fb7185 !important; }
.pmh-mobile-search { display: none !important; cursor: pointer; }
.pmh-notification-hint {
    margin: 4px 4px 8px; padding: 10px 12px; border: 1px solid var(--pmh-border); border-radius: 11px;
    background: var(--pmh-surface-2); color: var(--pmh-muted); font-size: 12px; line-height: 1.45;
}

.pmh-push-prompt {
    --pp-bg: #181b22;
    --pp-text: #f4f5f7;
    --pp-muted: #9399a6;
    --pp-border: rgba(255,255,255,.09);
    --pp-primary: #3ea6ff;
    --pp-primary-hover: #65b8ff;
    position: fixed; z-index: 99990; right: 22px; bottom: 22px;
    display: grid; grid-template-columns: 40px minmax(0,1fr) 28px; grid-template-areas: "icon copy close" "actions actions actions";
    gap: 12px 14px; width: min(380px, calc(100vw - 32px)); padding: 16px; box-sizing: border-box;
    border: 1px solid var(--pp-border); border-radius: 17px; background: var(--pp-bg); color: var(--pp-text);
    box-shadow: 0 24px 65px rgba(0,0,0,.42);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left; opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
    -webkit-font-smoothing: antialiased;
}
.pmh-push-prompt.is-visible { opacity: 1; transform: none; }
.pmh-theme-claro .pmh-push-prompt {
    --pp-bg: #fff;
    --pp-text: #171923;
    --pp-muted: #687080;
    --pp-border: rgba(15,23,42,.1);
    box-shadow: 0 24px 65px rgba(15,23,42,.16);
}
.pmh-push-prompt *, .pmh-push-prompt *::before, .pmh-push-prompt *::after { box-sizing: border-box; }
.pmh-push-prompt-icon {
    grid-area: icon; align-self: start;
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
    background: color-mix(in srgb, var(--pp-primary) 14%, transparent); color: var(--pp-primary);
}
.pmh-push-prompt-icon svg { width: 20px; height: 20px; }
.pmh-push-prompt-copy { grid-area: copy; min-width: 0; }
.pmh-push-prompt-copy strong { display: block; margin: 0 0 4px; color: var(--pp-text); font-size: 15px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.pmh-push-prompt-copy p { margin: 0 !important; color: var(--pp-muted) !important; font-size: 13px !important; line-height: 1.45 !important; }
.pmh-push-prompt-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pmh-push-prompt-actions:empty { display: none; }
.pmh-push-prompt button {
    font: inherit !important; text-transform: none !important; letter-spacing: normal !important; cursor: pointer;
}
.pmh-push-prompt .pmh-push-primary {
    min-height: 32px; padding: 0 12px !important; border: 0 !important; border-radius: 8px !important;
    background: var(--pp-primary) !important; color: #fff !important;
    font-size: 12.5px !important; font-weight: 500 !important; letter-spacing: -0.011em !important; box-shadow: none !important;
}
.pmh-push-primary:hover:not(:disabled) { background: var(--pp-primary-hover) !important; }
.pmh-push-primary:disabled { opacity: .7; cursor: default; }
.pmh-push-prompt .pmh-push-ghost {
    min-height: 32px; padding: 0 12px !important; border: 1px solid var(--pp-border) !important; border-radius: 8px !important;
    background: transparent !important; color: var(--pp-muted) !important;
    font-size: 12.5px !important; font-weight: 500 !important; letter-spacing: -0.011em !important;
    box-shadow: none !important;
}
.pmh-push-ghost:hover { background: rgba(127,127,127,.12) !important; color: var(--pp-text) !important; }
.pmh-push-primary:focus-visible, .pmh-push-ghost:focus-visible, .pmh-push-prompt-close:focus-visible {
    outline: none !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-primary) 40%, transparent) !important;
}
.pmh-push-prompt-close {
    grid-area: close; align-self: start; justify-self: end;
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0 !important;
    border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--pp-muted) !important;
}
.pmh-push-prompt-close svg { width: 16px; height: 16px; }
.pmh-push-prompt-close:hover { background: rgba(127,127,127,.14) !important; color: var(--pp-text) !important; }
@media (prefers-reduced-motion: reduce) {
    .pmh-push-prompt { transition: none; transform: none; }
}

@media (max-width: 800px) {
    :root { --pmh-height: 64px; }
    .pmh-inner { width: calc(100% - 22px); grid-template-columns: 1fr auto auto; gap: 5px; }
    .pmh-brand img { max-width: 135px; height: 36px; }
    .pmh-search {
        display: none; position: fixed; top: calc(var(--pmh-height) + 8px); left: 11px; right: 11px; width: auto;
        padding: 9px; border: 1px solid var(--pmh-border); border-radius: 16px; background: var(--pmh-surface);
        box-shadow: 0 22px 60px rgba(0,0,0,.45);
    }
    .admin-bar .pmh-search { top: calc(var(--pmh-height) + 54px); }
    .pmh.is-search-open .pmh-search { display: block; }
    .pmh-search > svg { left: 23px; }
    .pmh-search input { padding-left: 42px !important; }
    .pmh-results { top: 60px; }
    .pmh-mobile-search { display: inline-flex !important; }
    .pmh-user-name, .pmh-user-button > svg { display: none; }
    .pmh-user-button { min-height: 42px; padding: 2px !important; }
    .pmh-icon { width: 38px; height: 38px; flex-basis: 38px; }
}
@media (max-width: 480px) {
    .admin-bar .pmh { top: 46px; }
    .pmh-brand img { max-width: 112px; height: 32px; }
    .pmh-actions { gap: 1px; }
    .pmh-icon { width: 34px; height: 36px; flex-basis: 34px; }
    .pmh-user-button .pmh-avatar { width: 34px; height: 34px; }
    .pmh-menu { position: fixed; top: calc(var(--pmh-height) + 8px); right: 10px; width: min(290px,calc(100vw - 20px)); }
    .admin-bar .pmh-menu { top: calc(var(--pmh-height) + 54px); }
    .pmh-notification-panel { position: fixed; top: calc(var(--pmh-height) + 8px); right: 10px; width: calc(100vw - 20px); }
    .admin-bar .pmh-notification-panel { top: calc(var(--pmh-height) + 54px); }
    .pmh-push-prompt { right: 12px; bottom: 12px; grid-template-columns: 36px minmax(0,1fr) 28px; width: min(380px, calc(100vw - 24px)); gap: 10px 12px; padding: 14px; }
    .pmh-push-prompt-icon { width: 36px; height: 36px; }
}
