.page-head{
    position:relative;
    z-index:200;
    overflow:visible;
    min-height:auto;
    margin:10px 0 12px;
    padding:10px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:var(--radius-card, 12px);
    background:var(--gradient-card);
    box-shadow:var(--shadow-card);
}

.page-head-copy,
.page-head-actions{
    min-width:0;
}

.page-eyebrow{
    display:inline-flex;
    align-items:center;
    gap:5px;
    margin-bottom:2px;
    color:var(--text-muted, var(--text-secondary));
    font-size:var(--text-2xs, 0.625rem);
    font-weight:600;
    letter-spacing:.1em;
    text-transform:uppercase;
    line-height:1.25;
}

.page-eyebrow::before{
    content:"";
    width:5px;
    height:5px;
    border-radius:50%;
    background:var(--primary, var(--primary));
}

.page-head h1{
    margin:0;
    color:var(--text-title, var(--text-main));
    font-size:var(--text-xl);
    line-height:1.2;
    font-weight:600;
    letter-spacing:0;
}

.page-head-subtitle{
    margin:4px 0 0;
    color:var(--text-muted, var(--text-secondary));
    font-size:var(--text-sm, 0.75rem);
    line-height:1.4;
    max-width:840px;
}

.page-head-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}

.page-head-actions:empty,
.page-head__toolbar:empty,
.page-head__utilities:empty,
.page-head__profile:empty{
    display:none;
}

.page-head__toolbar,
.page-head__utilities,
.page-head__profile,
.page-head__utility-zone{
    min-width:0;
}

.page-head__toolbar{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.page-head__utility-zone{
    position:relative;
    flex:0 0 auto;
}

.page-head__utilities{
    display:flex;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}

.select-clean{
    min-width:128px;
    height:34px;
    padding:0 10px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:var(--radius-small, 8px);
    outline:none;
    background:var(--bg-card-dark);
    color:var(--text-main);
    font:500 var(--text-sm, 0.75rem)/1.3 var(--font-sans);
    box-shadow:none;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.select-clean:focus{
    border-color:var(--accent-cyan);
    box-shadow:var(--shadow-cyan);
}

.theme-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    flex:0 0 34px;
    padding:0;
    border:1px solid var(--border-soft, var(--border));
    border-radius:5px;
    background:var(--bg-card-dark);
    color:var(--text-main);
    cursor:pointer;
    transition:border-color .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

.notification-menu{
    position:relative;
    flex:0 0 auto;
}

.notification-bell{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    flex:0 0 34px;
    padding:0;
    border:1px solid var(--border-soft, var(--border));
    border-radius:5px;
    background:var(--bg-card-dark);
    color:var(--text-main);
    cursor:pointer;
    transition:border-color .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease;
}

.notification-bell:hover,
.notification-bell[aria-expanded="true"]{
    border-color:var(--primary-light);
    box-shadow:var(--shadow-blue);
    color:var(--primary);
}

.notification-bell.has-alerts{
    border-color:var(--border-soft, var(--border));
    color:var(--danger);
}

.notification-bell:focus-visible{
    outline:2px solid var(--primary-light);
    outline-offset:2px;
}

.notification-bell__badge{
    position:absolute;
    top:-6px;
    right:-6px;
    min-width:17px;
    height:17px;
    padding:0 5px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:2px solid var(--bg-card-dark);
    border-radius:999px;
    background:var(--danger);
    color:var(--text-white);
    font-size:9px;
    font-weight:700;
    line-height:1;
    font-variant-numeric:tabular-nums;
}

.notification-panel{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    z-index:1300;
    width:min(320px,calc(100vw - 32px));
    padding:10px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:12px;
    background:#fff;
    color:#102a43;
    box-shadow:0 18px 45px rgba(16,42,67,.18);
}

.notification-panel[hidden],
.page-head__alert-slot[hidden]{
    display:none;
}

.page-head__alert-slot{
    z-index:1300;
}

.notification-panel__head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:2px 2px 9px;
    border-bottom:1px solid var(--border-soft, var(--border));
}

.notification-panel__head strong{
    color:#0f172a;
    font-size:var(--text-sm, .75rem);
    line-height:1.2;
    font-weight:700;
}

.notification-panel__head span{
    min-width:24px;
    height:24px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid color-mix(in srgb,var(--warning) 42%,transparent);
    border-radius:12px;
    background:var(--warning-soft, color-mix(in srgb,var(--warning) 12%,transparent));
    color:var(--warning);
    font-size:var(--text-xs, .6875rem);
    font-weight:700;
    font-variant-numeric:tabular-nums;
}

.notification-item{
    display:grid;
    grid-template-columns:32px minmax(0,1fr);
    gap:10px;
    margin-top:10px;
    padding:10px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:12px;
    background:#f8fbff;
    transition:border-color .18s ease, background .18s ease, transform .18s ease;
}

.notification-item:hover{
    border-color:color-mix(in srgb,var(--warning) 44%,var(--border-soft, var(--border)));
    background:#eef6ff;
    transform:translateY(-1px);
}

.notification-item__icon{
    width:32px;
    height:32px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid color-mix(in srgb,var(--warning) 42%,transparent);
    border-radius:12px;
    background:var(--warning-soft, color-mix(in srgb,var(--warning) 12%,transparent));
    color:var(--warning);
}

.notification-item__copy{
    min-width:0;
    display:block;
}

.notification-item__copy strong{
    display:block;
    margin:0 0 2px;
    color:#0f172a;
    font-size:var(--text-sm, .75rem);
    line-height:1.25;
    font-weight:700;
}

.notification-item__copy small{
    display:block;
    color:#475569;
    font-size:var(--text-xs, .6875rem);
    line-height:1.35;
}

.notification-item__copy em{
    display:inline-flex;
    margin-top:7px;
    color:var(--primary);
    font-size:var(--text-xs, .6875rem);
    font-style:normal;
    font-weight:700;
}

.notification-empty{
    margin-top:10px;
    padding:12px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:12px;
    background:#f8fbff;
    color:#475569;
    font-size:var(--text-xs, .6875rem);
    line-height:1.35;
}

html[data-theme="dark"] .notification-panel{
    background:#061537;
    color:#f8fafc;
    box-shadow:0 18px 48px rgba(0,0,0,.48);
}

html[data-theme="dark"] .notification-panel__head strong,
html[data-theme="dark"] .notification-item__copy strong{
    color:#f8fafc;
}

html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .notification-empty{
    background:#07163f;
}

html[data-theme="dark"] .notification-item:hover{
    background:#0d2a6b;
}

html[data-theme="dark"] .notification-item__copy small,
html[data-theme="dark"] .notification-empty{
    color:#b8c7e6;
}

.theme-toggle:hover{
    border-color:var(--primary-light);
    box-shadow:var(--shadow-blue);
    color:var(--primary);
}

.theme-toggle:focus-visible{
    outline:2px solid var(--primary-light);
    outline-offset:2px;
}

.theme-toggle__icon{
    display:block;
}

.theme-toggle__icon--sun{
    display:none;
}

.theme-toggle.is-dark .theme-toggle__icon--moon{
    display:none;
}

.theme-toggle.is-dark .theme-toggle__icon--sun{
    display:block;
}

.user-mini-card{
    display:flex;
    align-items:center;
    gap:8px;
    min-height:34px;
    padding:4px 10px 4px 6px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:var(--radius-small, 8px);
    background:var(--bg-card-dark);
}

.avatar-circle{
    width:28px;
    height:28px;
    flex:0 0 28px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:var(--gradient-button);
    color:var(--text-white);
    font-size:11px;
    font-weight:600;
    overflow:hidden;
}

.avatar-circle--photo{
    background:var(--bg-soft, #eaf3ff);
    color:transparent;
}

.avatar-circle img{
    width:100%;
    height:100%;
    display:block;
    object-fit:cover;
}

.user-mini-card strong{
    display:block;
    color:var(--text-main, var(--text-main));
    font-size:var(--text-sm, 0.75rem);
    line-height:1.2;
    font-weight:600;
}

.user-mini-card__copy{
    min-width:0;
    flex:1 1 auto;
}

.user-mini-card__copy strong{
    display:block;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.page-head__profile-row{
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
    min-width:0;
}

.page-head__profile-row .user-mini-card{
    flex:1 1 auto;
    min-width:0;
}

.dashboard-filter-toggle{
    display:none;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    flex:0 0 38px;
    margin:0;
    padding:0;
    border:1px solid var(--border-soft, var(--border));
    border-radius:12px;
    background:var(--bg-card-dark);
    color:var(--primary, var(--dash-primary));
    cursor:pointer;
    box-shadow:var(--shadow-card);
    transition:border-color .18s ease, background-color .18s ease, color .18s ease;
}

.dashboard-filter-toggle:hover{
    border-color:var(--accent-cyan);
    color:var(--accent-cyan);
}

.dashboard-filter-toggle[aria-expanded="true"]{
    border-color:color-mix(in srgb,var(--primary) 42%,var(--border-soft));
    background:color-mix(in srgb,var(--primary) 10%,var(--bg-card-dark));
    color:var(--primary-dark, var(--primary));
}

.dashboard-filter-toggle:focus-visible{
    outline:2px solid color-mix(in srgb,var(--accent-cyan) 55%,transparent);
    outline-offset:2px;
}

.user-mini-card small{
    display:block;
    margin-top:1px;
    color:var(--text-muted, var(--text-secondary));
    font-size:var(--text-2xs, 0.625rem);
    line-height:1.25;
}

.user-menu{
    position:relative;
    flex:1 1 auto;
    min-width:0;
}

.user-menu .user-mini-card--button{
    width:100%;
    font:inherit;
    text-align:left;
    cursor:pointer;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.user-menu .user-mini-card--button:hover{
    border-color:color-mix(in srgb,var(--primary) 45%,var(--border-soft, var(--border)));
}

.user-menu .user-mini-card--button:focus-visible{
    outline:2px solid color-mix(in srgb,var(--accent-cyan) 55%,transparent);
    outline-offset:2px;
}

.user-mini-card__chevron{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    color:var(--text-muted, var(--text-secondary));
    transition:transform .18s ease;
}

.user-mini-card--button[aria-expanded="true"]{
    border-color:color-mix(in srgb,var(--primary) 45%,var(--border-soft, var(--border)));
    box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent);
}

.user-mini-card--button[aria-expanded="true"] .user-mini-card__chevron{
    transform:rotate(180deg);
}

.user-menu__panel{
    position:absolute;
    top:calc(100% + 6px);
    right:0;
    z-index:60;
    min-width:210px;
    padding:6px;
    border:1px solid var(--border-soft, var(--border));
    border-radius:12px;
    background:var(--bg-card-dark, #fff);
    box-shadow:0 14px 34px rgba(2, 11, 47, .18);
    animation:userMenuIn .16s ease both;
}

@keyframes userMenuIn{
    from{opacity:0;transform:translateY(-4px);}
    to{opacity:1;transform:translateY(0);}
}

.user-menu__item{
    display:flex;
    align-items:center;
    gap:9px;
    padding:8px 10px;
    border-radius:8px;
    border-left:2px solid transparent;
    color:var(--text-main);
    font-size:var(--text-sm, 0.78rem);
    font-weight:600;
    text-decoration:none;
    transition:background-color .14s ease, color .14s ease, border-color .14s ease;
}

.user-menu__item:hover,
.user-menu__item:focus-visible{
    background:color-mix(in srgb,var(--primary) 9%,transparent);
    border-left-color:var(--primary);
    color:var(--primary-dark, var(--primary));
    outline:none;
}

.user-menu__icon{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    color:var(--text-muted, var(--text-secondary));
}

.user-menu__item:hover .user-menu__icon,
.user-menu__item:focus-visible .user-menu__icon{
    color:var(--primary);
}

.user-menu__badge{
    margin-left:auto;
    min-width:18px;
    padding:1px 6px;
    border-radius:999px;
    background:var(--primary);
    color:#fff;
    font-size:0.65rem;
    font-weight:700;
    text-align:center;
}

.user-menu__divider{
    height:1px;
    margin:5px 8px;
    background:var(--border-soft, var(--border));
}

.user-menu__item--danger{
    color:var(--danger, #B42318);
}

.user-menu__item--danger .user-menu__icon{
    color:var(--danger, #B42318);
}

.user-menu__item--danger:hover,
.user-menu__item--danger:focus-visible{
    background:color-mix(in srgb,var(--danger, #B42318) 9%,transparent);
    border-left-color:var(--danger, #B42318);
    color:var(--danger, #B42318);
}

.user-menu__item--danger:hover .user-menu__icon{
    color:var(--danger, #B42318);
}

@media (max-width:980px){
    .page-head{
        margin:8px 0 10px;
        padding:10px 12px;
    }
}

@media (min-width:1280px){
    .page-head{
        display:flex;
        align-items:center;
        gap:12px;
    }

    .page-head-copy{
        flex:1 1 auto;
        min-width:0;
    }

    .page-head__toolbar,
    .page-head__utilities,
    .page-head__profile,
    .page-head__utility-zone{
        flex:0 0 auto;
    }

    .page-head__utility-zone{
        position:relative;
    }

    .page-head__alert-slot{
        position:absolute;
        top:calc(100% + 8px);
        right:0;
        left:auto;
        width:min(320px, calc(100vw - 32px));
    }
}

@media (max-width:1279px){
    html.has-app-bottom-nav .page-head{
        position:relative;
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:8px;
        margin:0 0 16px;
        padding:16px;
        border-radius:20px;
        overflow:visible;
    }

    html.has-app-bottom-nav .page-head-copy{
        min-width:0;
        padding-right:92px;
    }

    html.has-app-bottom-nav .page-head__utility-zone{
        display:contents;
    }

    html.has-app-bottom-nav .page-head__utilities{
        position:absolute;
        top:14px;
        right:14px;
        display:flex;
        align-items:center;
        gap:8px;
        z-index:3;
    }

    html.has-app-bottom-nav .page-head__alert-slot{
        position:static;
        top:auto;
        right:auto;
        left:auto;
        width:100%;
        max-width:none;
        margin:0;
        padding:12px;
        border-radius:14px;
        background:var(--bg-card-dark);
        box-shadow:none;
        transform:none;
    }

    html.has-app-bottom-nav .page-head__alert-slot .notification-panel__head{
        padding-bottom:10px;
    }

    html.has-app-bottom-nav .page-head__alert-slot .notification-item,
    html.has-app-bottom-nav .page-head__alert-slot .notification-empty{
        margin-top:0;
    }

    html.has-app-bottom-nav .page-head__toolbar{
        width:100%;
        display:none;
    }

    html.has-app-bottom-nav .page-head__toolbar.is-filter-open{
        display:block;
    }

    html.has-app-bottom-nav .page-head__profile{
        width:100%;
    }

    html.has-app-bottom-nav .page-head h1{
        font-size:var(--text-xl);
        line-height:1.3;
        overflow:visible;
        overflow-wrap:anywhere;
        word-break:break-word;
        white-space:normal;
        hyphens:auto;
    }

    html.has-app-bottom-nav .page-eyebrow{
        margin-bottom:4px;
    }

    html.has-app-bottom-nav .page-head__profile .user-mini-card{
        width:auto;
        height:44px;
        min-height:44px;
        max-height:44px;
        padding:0 10px 0 8px;
        border-radius:12px;
        gap:8px;
        box-sizing:border-box;
    }

    html.has-app-bottom-nav .page-head__profile .avatar-circle{
        width:28px;
        height:28px;
        flex-basis:28px;
        font-size:11px;
    }

    html.has-app-bottom-nav .page-head__profile .user-mini-card strong{
        font-size:12px;
        line-height:1.15;
    }

    html.has-app-bottom-nav .page-head__profile .user-mini-card small{
        font-size:10px;
        line-height:1.15;
        margin-top:1px;
    }

    html.has-app-bottom-nav .page-head__profile-row{
        align-items:center;
        gap:6px;
    }

    html.has-app-bottom-nav .dashboard-filter-toggle{
        display:inline-flex;
        width:44px;
        height:44px;
        min-height:44px;
        max-height:44px;
        flex:0 0 44px;
        border-radius:12px;
        box-shadow:none;
        box-sizing:border-box;
    }

    html.has-app-bottom-nav .page-head .dashboard-filter-form{
        display:grid;
        grid-template-columns:minmax(0, 1fr);
        gap:8px;
        width:100%;
    }

    html.has-app-bottom-nav .page-head .dashboard-filter-form:has(select + input),
    html.has-app-bottom-nav .page-head .dashboard-filter-form:has(.select-clean + .select-clean),
    html.has-app-bottom-nav .page-head .dashboard-filter-form:has(.select-clean + .dashboard-date-input){
        grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
    }

    html.has-app-bottom-nav .page-head .dashboard-filter-form .select-clean,
    html.has-app-bottom-nav .page-head .dashboard-filter-form .dashboard-date-input,
    html.has-app-bottom-nav .page-head .escala-filter-form .select-clean{
        width:100%;
        min-width:0;
        height:42px;
        padding:0 12px;
        border-radius:12px;
        font-size:13px;
    }

    html.has-app-bottom-nav .page-head .dashboard-filter-link{
        grid-column:1 / -1;
        justify-self:start;
        font-size:12px;
    }

    html.has-app-bottom-nav .notification-bell,
    html.has-app-bottom-nav .theme-toggle{
        width:40px;
        height:40px;
        flex-basis:40px;
        border-radius:12px;
    }
}


@media (max-width:760px){
    /* layout unificado via html.has-app-bottom-nav (mesmo do dashboard) */
}

.page-head--dashboard{
    margin:8px 0 10px;
    padding:8px 12px;
    gap:10px;
}

.page-head--dashboard h1{
    font-size:var(--text-xl);
}
