/* Overlay: fundo semi-transparente, cobre a tela */
.notifications-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.notifications-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Painel: ao lado da sidebar (à direita dela), fundo conforme tema, até o final da tela */
.notifications-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 56px; /* largura da sidebar recolhida */
    width: min(420px, calc(100vw - 56px - 24px));
    height: 100vh;
    min-height: 100vh;
    background: var(--card-bg, #fff);
    border-radius: 0 0 12px 12px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    border-left: 1px solid var(--border-color, transparent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-12px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Sidebar expandida: painel começa após os 240px da sidebar */
.main-container.sidebar-expanded .notifications-panel {
    left: 240px;
    width: min(420px, calc(100vw - 240px - 24px));
}

.notifications-overlay.is-open .notifications-panel {
    transform: translateX(0);
    opacity: 1;
}

.notifications-overlay:not(.is-open) .notifications-panel {
    transform: translateX(-12px);
    opacity: 0;
    pointer-events: none;
}

/* Header do painel */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid var(--ark-cinza-claro, #e7e9ed);
}

.notifications-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color, var(--ark-primaria, #001018));
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--primary-color, #5B8BB5);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 11px;
}

.notifications-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notifications-link {
    background: none;
    border: none;
    color: var(--primary-color, #5B8BB5);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
}

.notifications-link:hover {
    text-decoration: underline;
}

.notifications-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6B7C8E);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-close:hover {
    background: var(--ark-cinza-claro, #e7e9ed);
    color: var(--text-color, var(--ark-primaria, #001018));
}

/* Abas */
.notifications-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    background: var(--card-bg, #fff);
    border-bottom: 1px solid var(--ark-cinza-claro, #e7e9ed);
}

.notifications-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6B7C8E);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
}

.notifications-tab:hover {
    background: var(--ark-cinza-claro, #e7e9ed);
    color: var(--text-color, var(--ark-primaria, #001018));
}

.notifications-tab.active {
    background: var(--primary-color, #5B8BB5);
    color: #fff;
}

/* Lista rolável */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 200px;
}

.notifications-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-secondary, #6B7C8E);
    font-size: 14px;
}

/* Item de notificação */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    position: relative;
    border-bottom: 1px solid var(--ark-cinza-claro, #e7e9ed);
    background: var(--card-bg, #fff);
}

.notification-item:hover {
    background: var(--ark-fundo-claro, #f3f5f7);
}

.notification-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--ark-cinza-medio, #d8dadf);
}

.notification-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color, #5B8BB5);
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-text {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-color, var(--ark-primaria, #001018));
    line-height: 1.4;
}

.notification-detail {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary, #6B7C8E);
    padding-left: 8px;
    border-left: 2px solid var(--ark-cinza-medio, #d8dadf);
    line-height: 1.4;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.btn-accept,
.btn-deny {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.btn-accept {
    background: var(--primary-color, #5B8BB5);
    color: #fff;
}

.btn-accept:hover {
    filter: brightness(1.1);
}

.btn-deny {
    background: var(--ark-cinza-claro, #e7e9ed);
    color: var(--text-color, var(--ark-primaria, #001018));
}

.btn-deny:hover {
    background: var(--ark-cinza-medio, #d8dadf);
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary, #6B7C8E);
}

.notification-dot {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color, #5B8BB5);
}

@media (max-width: 768px) {
    .notifications-panel {
        left: 48px;
        width: calc(100vw - 48px - 16px);
        max-height: 90vh;
    }

    .main-container.sidebar-expanded .notifications-panel {
        left: 240px;
        width: calc(100vw - 240px - 16px);
    }
}
