﻿﻿﻿﻿/* =========================
   FIX GERAL
========================= */
.mud-popover {
    z-index: 9999 !important;
}

/* Shell: igual ao ZIP — sidebar fixa (.pj-sidebar) + conteúdo com margin-left e rolagem
   do próprio documento (barra de rolagem na altura total da janela, topbar sticky). */
.app-shell {
    position: relative;
    min-height: 100vh;
    background: var(--mud-palette-background);
}

/* ── Sidebar ──────────────────────────────────────────── */
.sb-sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-drawer-background);
    border-right: 1px solid var(--mud-palette-divider);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    /* ÚNICA transição — sem conflito com MudBlazor */
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado recolhido */
.app-shell.sb-collapsed .sb-sidebar {
    width: 64px;
    min-width: 64px;
}

/* ── Área principal ─────────────────────────────────────
   margin-left = largura da sidebar fixa (240px; 64px recolhida), como em
   .pj-layout / .pj-navbar do ZIP. */
.app-main {
    margin-left: 240px;
    min-width: 0;
    transition: margin-left .2s ease;
}

.app-shell.sb-collapsed .app-main {
    margin-left: 64px;
}

.app-body {
    min-height: calc(100vh - 64px);
    background-color: var(--mud-palette-background);
}

@media (max-width: 991.98px) {
    .app-main { margin-left: 0 !important; }
}

/* ── Overlay mobile ───────────────────────────────────── */
.sb-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ── Mobile: sidebar como drawer overlay ─────────────── */
@media (max-width: 959px) {
    .sb-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1200;
        width: 260px !important;
        min-width: 260px !important;
    }

    .app-shell.mobile-open .sb-sidebar {
        transform: translateX(0);
    }

    .app-shell.mobile-open .sb-mobile-overlay {
        display: block;
    }

    /* No mobile, o toggle de colapso fica escondido */
    .sb-toggle-btn {
        display: none !important;
    }
}

/* ── Raiz do sidebar (mantido para compatibilidade interna) ── */
.sb-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Brand ────────────────────────────── */
.sb-brand {
    display: flex;
    align-items: center;
    padding: 8px 28px 8px 12px; /* padding-right reserva espaço para o botão toggle */
    min-height: 56px;
    max-height: 56px;
    overflow: hidden;
    white-space: nowrap;
}

    .sb-brand .sb-company-name {
        flex: 1;
    }

    .sb-brand.collapsed {
        justify-content: center;
        padding: 12px 8px;
    }


.sb-pjzen-logo {
    width: 100%;
    height: auto;
    max-width: none;
    object-fit: contain;
    display: block;
}

.sb-pjzen-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    object-position: center;
    display: block;
}

.sb-logo {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(var(--mud-palette-primary-rgb), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .sb-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .sb-logo span {
        font-size: 16px;
        font-weight: 700;
        color: var(--mud-palette-primary);
    }

.sb-company-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    animation: sb-fade-in 0.2s ease;
}

@keyframes sb-fade-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Separador ────────────────────────── */
.sb-sep {
    height: 1px;
    background: var(--mud-palette-divider);
}

/* ── Nav ──────────────────────────────── */
.sb-nav {
    flex: 1;
    padding: 12px 8px 8px;
    margin-top: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Item base (links e botões de grupo) */
.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

    .sb-item:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--mud-palette-text-primary);
        text-decoration: none !important;
        transform: translateX(2px);
    }

    /* Estado ativo — Blazor NavLink adiciona classe "active" */
    .sb-item.active {
        background: rgba(37, 99, 235, 0.13) !important;
        color: #2563eb !important;
        font-weight: 600;
    }

    /* Garante que hover em cima do ativo não perde o estilo */
    .sb-item.active:hover {
        background: rgba(37, 99, 235, 0.18) !important;
        color: #2563eb !important;
        transform: none;
    }

    /* Modo ícone (collapsed) */
    .sb-item.icon-only {
        justify-content: center;
        padding: 9px;
    }

/* Ícone dentro de cada item */
.sb-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Grupo (toggle) ───────────────────── */
.sb-group-toggle .sb-arrow {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.22s ease;
}

.sb-group-toggle.open .sb-arrow {
    transform: rotate(-180deg);
}

/* ── Submenu ──────────────────────────── */
.sb-submenu {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 16px;
    padding-left: 16px;
}

    /* linha vertical */
    .sb-submenu::before {
        content: "";
        position: absolute;
        left: 6px;
        top: 4px;
        bottom: 4px;
        width: 2px;
        background: var(--mud-palette-divider);
        border-radius: 2px;
    }

.sb-sub-item {
    font-size: 13px;
    padding: 7px 12px 7px 16px;
    position: relative;
}

/* Indicador de "tem subitens" — barrinha embaixo do ícone */
.sb-has-flyout {
    position: relative;
    flex-direction: column;
    gap: 3px;
    padding-bottom: 11px !important;
}

    .sb-has-flyout::after {
        content: '';
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 16px;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        opacity: 0.28;
        transition: opacity 0.15s ease, width 0.15s ease;
    }

    .sb-has-flyout:hover::after {
        opacity: 0.55;
    }

    .sb-has-flyout.flyout-active {
        background: rgba(37, 99, 235, 0.13) !important;
        color: #2563eb !important;
    }

    .sb-has-flyout.flyout-active::after {
        opacity: 0.8;
        background: #2563eb;
    }

/* Painel flutuante fixo */
.sb-flyout-panel {
    position: fixed;
    left: 72px;
    min-width: 200px;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    z-index: 9999;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: flyout-in 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

    /* Setinha apontando para o sidebar */
    .sb-flyout-panel::before {
        content: '';
        position: absolute;
        left: -6px;
        top: 14px;
        width: 10px;
        height: 10px;
        background: var(--mud-palette-surface);
        border-left: 1px solid var(--mud-palette-divider);
        border-bottom: 1px solid var(--mud-palette-divider);
        transform: rotate(45deg);
        border-radius: 1px;
    }

@keyframes flyout-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Título do grupo no flyout */
.sb-flyout-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mud-palette-text-secondary);
    padding: 6px 10px 4px;
}

/* Item de link dentro do flyout */
.sb-flyout-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--mud-palette-text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.12s ease, color 0.12s ease;
    cursor: pointer;
    white-space: nowrap;
}

    .sb-flyout-item:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--mud-palette-text-primary);
        text-decoration: none !important;
    }

    .sb-flyout-item.active {
        background: rgba(37, 99, 235, 0.10);
        color: #2563eb;
        font-weight: 600;
    }

/* Backdrop invisível — fecha ao clicar fora */
.sb-flyout-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}

/* ── Footer ───────────────────────────── */
.sb-footer {
    padding: 8px;
    flex-shrink: 0;
}

.sb-footer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

    .sb-footer-row.center {
        justify-content: center;
    }

/* Botão de tema */
.sb-theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: var(--mud-palette-action-hover);
    color: var(--mud-palette-text-primary);
    transition: background 0.15s ease;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

    .sb-theme-btn.expand {
        flex: 1;
    }

    .sb-theme-btn:hover {
        background: var(--mud-palette-action-default-hover);
    }

/* Botão recolher/expandir — circular, alinhado ao centro do logo */
.sb-toggle-btn {
    position: absolute;
    right: -14px;
    top: 14px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

    .sb-toggle-btn:hover {
        background: var(--mud-palette-primary);
        color: #fff;
        border-color: var(--mud-palette-primary);
        transform: scale(1.08);
    }

/* =========================
   TOPBAR
========================= */
.topbar-modern {
    height: 60px;
    background-color: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-divider);
    display: flex;
    align-items: center;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Avatar do usuário na topbar */
.topbar-avatar-wrap {
    cursor: pointer;
    display: flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}

.topbar-avatar {
    width: 38px !important;
    height: 38px !important;
    border: 2px solid var(--mud-palette-divider);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

    .topbar-avatar-wrap:hover .topbar-avatar {
        border-color: var(--mud-palette-primary);
        transform: scale(1.05);
    }

/* =========================
   NOTIFICAÇÃO
========================= */
.notification-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--mud-palette-primary);
    border-radius: 50%;
}

.notification-popover {
    width: 340px;
    border-radius: 12px;
    border: 1px solid var(--mud-palette-divider);
    background-color: var(--mud-palette-surface);
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    cursor: pointer;
}

    .notification-item.unread {
        background-color: var(--mud-palette-action-hover);
    }

.notif-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.bg-success {
    background: var(--mud-palette-success);
}

.bg-warning {
    background: var(--mud-palette-warning);
}

.bg-primary {
    background: var(--mud-palette-primary);
}

.notif-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.notification-footer {
    padding: 6px;
}

/* =========================
   EMPRESAS
========================= */
.company-switch-trigger {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

/* ANIMAÇÃO DO PILL */
.company-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    transition: all 0.25s ease;
}

    .company-pill:hover {
        background: var(--mud-palette-action-hover);
        transform: translateY(-1px);
    }

    .company-pill.open {
        background: var(--mud-palette-action-hover);
    }

.company-pill-arrow {
    font-size: 18px;
    color: var(--mud-palette-text-secondary);
    transition: transform 0.25s ease, color 0.2s ease;
}

.company-pill.open .company-pill-arrow {
    transform: rotate(180deg);
    color: var(--mud-palette-text-primary);
}

.company-pill-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--mud-palette-background);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .company-pill-icon img {
        width: 70%;
        height: 70%;
        object-fit: contain;
    }

.company-pill-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.company-pill-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.company-pill-sub {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
}

.company-pill-arrow {
    font-size: 18px;
    color: var(--mud-palette-text-secondary);
}

/* =========================
    MENU PAEA ESCOLHER EMPRESAS
========================= */

.company-popover {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    transform: translateX(15px) !important;
}

.company-header {
    padding: 14px 16px 8px;
    margin-left: 15px;
}

.company-header-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.company-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 8px;
    scroll-behavior: smooth;
    left: 15px !important;
}

.company-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 2px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

    .company-item:hover {
        background: var(--mud-palette-action-default-hover) !important;
        transform: translateX(2px);
    }

    .company-item.selected {
        background: rgba(var(--mud-palette-primary-rgb), 0.15);
    }

.company-avatar-container {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.company-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.company-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-info span {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
}

.company-check {
    margin-left: auto;
    color: var(--mud-palette-primary);
}

/* =========================
   USUÁRIO
========================= */
.user-popover-container {
    width: 240px;
    overflow-y: hidden;
}

.user-popover {
    padding: 12px;
}

.user-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0 8px;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.user-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11.5px;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-button {
    justify-content: flex-start !important;
    border-radius: 8px;
    color: #ef4444 !important;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 8px 22px !important;
}

    /* HOVER */
    .logout-button:hover {
        background: rgba(239, 68, 68, 0.12) !important;
        color: #dc2626 !important;
        transform: translateX(2px);
    }

    /* ÍCONE */
    .logout-button .mud-icon-root {
        color: inherit !important;
    }

.mud-popover-content {
    max-height: none !important;
    overflow: hidden !important;
}

.mud-list {
    max-height: none !important;
    overflow: hidden !important;
}
.user-initials-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.user-initials-avatar-md {
    width: 45px;
    height: 45px;
    font-size: 20px;
}

.user-popover,
.user-popover-container,
.mud-popover,
.mud-popover-content,
.mud-paper {
    box-shadow: none !important;
}

.mud-paper {
    box-shadow: none !important;
}

/* =========================
   MODAL CENTRAL DE NOTIFICAÇÕES
========================= */

/* Overlay */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 48px;
    padding-bottom: 48px;
    overflow-y: auto;
    animation: notif-fade-in 0.18s ease;
}

@keyframes notif-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Caixa principal do modal */
.notif-modal {
    background: var(--mud-palette-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    margin: 0 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    animation: notif-slide-up 0.22s ease;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 96px);
}

@keyframes notif-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Navbar interna */
.notif-modal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 12px 8px;
    border-bottom: 1px solid var(--mud-palette-divider);
    background: var(--mud-palette-surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

.notif-back-btn {
    color: var(--mud-palette-text-secondary) !important;
}

/* Toolbar: filtros + busca */
.notif-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-divider);
    flex-wrap: wrap;
}

/* Grupo de abas de filtro */
.notif-filter-group {
    display: flex;
    gap: 4px;
    background: var(--mud-palette-background-grey);
    border-radius: 10px;
    padding: 4px;
}

.notif-filter-tab {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

    .notif-filter-tab.active {
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    }

    .notif-filter-tab:hover:not(.active) {
        color: var(--mud-palette-text-primary);
    }

/* Campo de busca */
.notif-search-field {
    min-width: 200px;
    max-width: 260px;
}

    .notif-search-field .mud-input-outlined {
        font-size: 13px;
    }

/* Lista de notificações */
.notif-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Item individual */
.notif-modal-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-divider);
    transition: background 0.15s ease;
    cursor: default;
}

    .notif-modal-item:last-child {
        border-bottom: none;
    }

    .notif-modal-item:hover {
        background: var(--mud-palette-background-grey);
    }

    .notif-modal-item.unread {
        background: rgba(var(--mud-palette-primary-rgb), 0.04);
    }

        .notif-modal-item.unread:hover {
            background: rgba(var(--mud-palette-primary-rgb), 0.08);
        }

/* Ícone colorido */
.notif-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon-success {
    background: rgba(var(--mud-palette-success-rgb), 0.12) !important;
    color: var(--mud-palette-success) !important;
}

.notif-icon-warning {
    background: rgba(var(--mud-palette-warning-rgb), 0.12) !important;
    color: var(--mud-palette-warning) !important;
}

.notif-icon-info {
    background: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
}

/* Conteúdo do item */
.notif-modal-body {
    flex: 1;
    min-width: 0;
}

.notif-title-text {
    line-height: 1.4;
    word-break: break-word;
}

.notif-time-text {
    color: var(--mud-palette-text-secondary) !important;
    display: block;
    margin-top: 2px;
}

/* Bolinha de não lida */
.notif-unread-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    background: rgba(var(--mud-palette-primary-rgb), 1);
    margin-top: 5px;
}

/* Botões de ação por item */
.notif-action {
    font-size: 12px;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

    .notif-action:hover { opacity: 0.75; }

    .notif-action.primary {
        color: var(--mud-palette-primary);
    }

    .notif-action.danger {
        color: var(--mud-palette-text-disabled);
    }

        .notif-action.danger:hover {
            color: var(--mud-palette-error);
        }

/* Estado vazio */
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    gap: 8px;
}

.notif-empty-icon {
    opacity: 0.2;
}

.notif-empty-text {
    color: var(--mud-palette-text-secondary) !important;
}

/* Footer */
.notif-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--mud-palette-divider);
}

.notif-load-more-btn {
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-color: var(--mud-palette-divider) !important;
    color: var(--mud-palette-text-secondary) !important;
    text-transform: none !important;
}

    .notif-load-more-btn:hover {
        background: var(--mud-palette-background-grey) !important;
    }

.user-popover-container {
    max-height: none !important;
    overflow: hidden !important;
}



/* =========================
   MODAL DE PERFIL
========================= */
.profile-modal-content {
    border-radius: 20px !important;
    border: 1px solid var(--mud-palette-divider) !important;
    background: var(--mud-palette-surface) !important;
    overflow: hidden;
}

.profile-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 20px;
    background: var(--mud-palette-surface);
}

.profile-modal-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    line-height: 1.3;
}

.profile-modal-email {
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

.profile-close-btn {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--mud-palette-action-hover);
    color: var(--mud-palette-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 13px;
}

.profile-close-btn:hover {
    background: var(--mud-palette-action-default-hover);
    color: var(--mud-palette-text-primary);
}

.profile-tabs-wrap {
    padding: 0 20px 4px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.profile-tabs {
    gap: 2px;
    flex-wrap: nowrap;
}

.profile-tabs .nav-link {
    border-radius: 8px 8px 0 0 !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    padding: 8px 18px;
    border: none !important;
    background: transparent !important;
    transition: color 0.15s ease, background 0.15s ease;
    position: relative;
}

.profile-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: transparent;
    transition: background 0.15s ease;
}

.profile-tabs .nav-link.active {
    color: var(--mud-palette-primary) !important;
    background: transparent !important;
}

.profile-tabs .nav-link.active::after {
    background: var(--mud-palette-primary);
}

.profile-tabs .nav-link:hover:not(.active) {
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-action-hover) !important;
}

.profile-modal-body {
    padding: 20px 24px 24px !important;
}

.profile-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.profile-input {
    width: 100%;
    background: var(--mud-palette-background) !important;
    border: 1px solid var(--mud-palette-divider) !important;
    border-radius: 10px !important;
    color: var(--mud-palette-text-primary) !important;
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.profile-input:focus {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.profile-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mud-palette-primary) !important;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 11px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    width: 100%;
}

.profile-btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.profile-feedback {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

.profile-feedback.success {
    background: rgba(16, 185, 129, 0.10);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.profile-feedback.danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Dark mode: modal backdrop tinting */
.mud-dark .modal-backdrop {
    background-color: rgba(0,0,0,0.7);
}

/* =========================
   RESPONSIVIDADE EXTRA
========================= */

@media (max-width: 600px) {
    /* Topbar mais compacta */
    .topbar-modern { padding: 0 10px; }
    .topbar-actions { gap: 4px; }

    /* Esconde info da empresa no pill (mantém só ícone) */
    .company-pill-info { display: none; }
    .company-pill { padding: 5px 10px; gap: 6px; }
    .company-pill-arrow { font-size: 16px; }

    /* Popover de notificações: full-width menos margens */
    .notification-popover {
        width: calc(100vw - 24px) !important;
        max-width: 400px;
    }

    /* Modal de notificações */
    .notif-modal { margin: 0 8px; border-radius: 12px; }
    .notif-modal-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
    .notif-filter-group { width: 100%; overflow-x: auto; }
    .notif-search-field { max-width: 100%; min-width: 0; }
    .notif-modal-item { padding: 12px 14px; gap: 10px; }
}

@media (max-width: 400px) {
    .company-pill { display: none; }
    .topbar-modern { padding: 0 8px; }
}

/* Dropdown de empresas mobile */
@media (max-width: 480px) {
    .company-popover {
        width: calc(100vw - 32px) !important;
        min-width: 0 !important;
        max-width: 320px !important;
    }
}

/* ══════════════════════════════════════════
   OVERLAY — Troca de empresa/filial
══════════════════════════════════════════ */
.company-switch-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cs-fade-in 0.15s ease both;
}

@keyframes cs-fade-in {
    from { opacity: 0 }
    to   { opacity: 1 }
}

.company-switch-card {
    background: var(--mud-palette-surface, #fff);
    border-radius: 16px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: cs-pop-in 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
    min-width: 280px;
}

@keyframes cs-pop-in {
    from { opacity: 0; transform: scale(0.88) translateY(10px) }
    to   { opacity: 1; transform: scale(1)    translateY(0)    }
}

.company-switch-spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid var(--mud-palette-divider, #e5e7eb);
    border-top-color: var(--mud-palette-primary, #2563eb);
    border-radius: 50%;
    animation: cs-spin 0.75s linear infinite;
}

@keyframes cs-spin {
    to { transform: rotate(360deg) }
}

.company-switch-label {
    font-size: 14px;
    color: var(--mud-palette-text-secondary, #6b7280);
    text-align: center;
    line-height: 1.5;
}

.company-switch-label strong {
    color: var(--mud-palette-text-primary, #111827);
    font-weight: 600;
}


/* Topbar mobile (index.html do ZIP): abaixo de 992px a .pj-sidebar fica escondida
   (pjzen-design-system.css); o hambúrguer da topbar (d-lg-none) a abre como drawer. */
@media (max-width: 991.98px) {
    .app-shell.mobile-open .pj-sidebar {
        display: flex !important;
        width: 260px !important;
        min-width: 260px !important;
        height: 100dvh;
        overflow-y: auto;
        z-index: 1200;
        box-shadow: var(--pj-shadow-lg);
    }
    .app-shell.mobile-open .sb-mobile-overlay { display: block; z-index: 1100; }
}
